I've tried the following with a pitcher a couple of years ago and it fixed her upper body lean. I had the athlete attach a rope to a backstop or fencing in which she could throw against. Had her set up sideways to the fence with feet astride (stride foot forward) while holding on to the rope. There should be no slack in the rope. Upper body should be vertical or close throughout the arm circle. The pitcher throws into the backstop without striding forward (keeping her stride foot in place). Back knee can come forward. Objective is to keep the rope taut at release and after release. After release, pitcher should feel as if she would perhaps fall back if not holding on to the rope. She worked on this drill until she could do it without a rope. After release, she would slowly fall back onto her drive foot. She also worked on front side resistance as well. Surprisingly, it didn't take very long to fix the problem.
One cue that helped my DD was to "grow" once the front foot touched. I also noticed that the lean was worse the more she allowed her glove to swim and/or landed to her glove side of the line to home.