The whole time he has been coasting on his Natural Genetics and Devil Fruit control.
Due to being rubber permanently Luffy could not get stronger by Lifting weights like all other people in the One Piece world could. His whole lIfe age 7-10 since eating his devil fruit was spent on perfecting his devil fruit control.
During the timeskip, he spent majority of his time on mastering the basics of all 3 haki, and fusing Haki with his devil fruit.
As the Gomu Gomu no Mi is the hardest Devil Fruit to use in the world of One Piece.
Luffy uses take 3x the energy of a regular person just by existing. Moving takes even more energy.
Siince he his devil fruitt has been effect has been weakened suing seastone cuffs , it allowed his body to behave as the normal human body does
In Udon Prison he has been working out using seastone cuffs.
For the first time in his life, Luffy actually worked on his base physical strength.
This is the first time he would be able to break some muscle tissue encouraging his muscles to grow from training them, which would be probably way harder, or perhaps impossible to do any other way, when his muscles are made of rubber.
Muscles more or less grow stronger as fibers strain and break down through exertion, bolstered by the body’s production of greater muscle mass in response upon recuperating.
In Luffy’s case, his rubber abilities get in the way of this natural strengthening process as they allow his muscles to stretch without consequence.
By working out without his powers picking up the slack so to speak, his body is allowed to naturally respond to his increased physical demands and compensate accordingly. And with his powers at play he can basically overexert his now-greater muscle mass beyond a normal person’s ability to do so without fear of tearing.