Like the others said core muscles and going with the horse.
If your having a hard time posting any exersise like sit up/crunches (core strengthening exersises) would help you.
A great exersise you can do on the horse to practise keeping your lower body still, and working your core/leg muscles is to stand straight up making sure you don't move your legs and heels up, stand there for as long as you can. Do it at the halt, then when you get confident you can do it at the walk, and then the trot (trot is really fun! ).
Hope this helps :)