Focus as you rode on keeping your toe at the girth, toes up not out, make sure your stirrups aren't too long, lots of no stirrup work, bareback work as well.
Read the posts about keeping leg stable on the Tamarack Hill Farm Facebook page (Denny Emerson) he has all sorts of things to help!
No stirrups and put you weird deep in your heel!
Work on wrapping your leg around your horse and really keeping your heels
Lots of no stirrup work to make your leg stronger! Also check your stirrup length ( usually that's the culprit) and maybe check the balance in your saddle (stirrups should be inline with the girth for maximum stability).
I also struggle with this, but I always just tell my trainer to yell at me to fix them. It takes a lot of no stirrup work and patience and hard work, but you’ll get it!
Make sure stirrups are correct length. Usually if they are too short it makes legs swing back and if too long makes them swing forward
Agreed with the no stirrups, practice keeping centered in the saddle and your leg will stop swinging!
Work on no stirrup work! You can also temporarily (for about a month) tie your stirrups to the girth to retrain your leg placement. This with consistent no stirrup work should help! And don't forget that while you do no stirrup work, you should be focusing on engaging the inside of your calf!😊👍🏼
No stirrups for 10 minuets everyday