I can only speak for myself, but I stopped being obese and out of shape when I stopped being broke.
I began to eat fewer calories of higher quality food, hit my macros, and prevented muscle loss by going to the gym a few times a week.
It was a feedback loop with my social environment. Expectations of me changed when I finished school, and I didn't really think anything of it until I saw some results which only reinforced the new habits. Everyone was supportive and from there lots of other stuff in my life got cleaned up as well. I don't even drink as much as I used to.
I can't be alone in feeling this way. For me it was finding good people, being happy with my career, and not being so stressed out all the time as a result.