If you could post a video we could see better what is going on. Often, if your leg is out in front of where it should be, your upper body has not choice but to also go out in front of your seat, in order to balance yourself. This is what happens if you are posting in a chair seat, and mayb have stirrups too long. The saddle itself can also be the cause of having this positional problem.
One thing that helps me is to think of my leg as pushing down into the ground, straight down so I can stomp something on the ground, rather than thinking of them being still and my top moving up from them. It's just a visual image but helps to get them right under you because you need your whole foot , under you and parallet to the ground in order to stomp the ground well.