i had this problem too, honestly what I did about it, was I generally take a 3 mile walk every day, and I just made a conscious effort to stand up straight during the entire walk. It was really, really hard and kinda painful, but after a couple days my spine just sort of went 'okay, this is a thing, we should probably start having better posture now'.
Eugh that's a horrible explanation... but basically, if you force yourself to have good posture every possible moment, your body should just generally begin to correct itself and build those muscles. I mean, there are specific exercises for that too, but I've sort of found that they aren't really needed.