It's about body awareness and alignment. Proper ballet is exce;lent for that, as is Pilates, but you need to have an instructor who is hands on.
But really, you can fix it yourself - you just have to engage your core and abdominal muscles - your abs operate as a kind of corset if you engage them!
You need some body awareness - proprioception. Close your eyes, stand with your feet under your hips. Think about pulling your spine out of your pelvis, to create space between the bottom of your ribs and the hip bones (iliac crest) that jut out. But do this without raising your shoulders or pushing your chest forward so your back goes into a hyper arch - don't arch your back!
Get your shoulder girdle positioned over your pelvic girdle and aligned with a straight spine. Exert a gentle pressure to suck your navel to your backbone - again, don't do this by pushing out your chest, raising your shoulders or arching your back - you want a neutral spine and pelvis.
Think about the weight distribution through your feet - equally across the front foot pad and the heels - weight neither too far forward or too far back.
If you've been standing badly or without thought for most of your life, this will be hard to get - try what's called "constructive rest" (or semi-supine position) - lie down on your back with your knees bent and pointing up to the ceiling and your feet flat on the floor. Try to flatten out and expand your shoulder girdle on the floor. Have your feet at a distance from your butt that allows you to get your whole spine pretty much flat on the floor, and try to think of your ribs melting and flattening out into the floor. From there you can do a number of Pilates-based exercises in moving and working your pelvis, buit the main thing is to feel what an aligned & neutral spine feels like.