What are your tips not to lean forward when trotting, cantering and before a jump?

Stay full seat at all times and let the horse pull you into two point. Lots of grid work will help and grid work with no s
I actually was in th same boat with you especially during trot to canter transitions. In canter, if you lean to far forward you won’t feel your seat bones (easier if you have a horse that has a slow canter, harder on a horse that has a crazy speed canter) but think about opening up your chest and sitting back, even though it might feel weird, make it your focus and eventually it’ll become something you’ll automatically do. Think of the alignment, should hip heel.
Definelty recommend no stirrup work.
Also when rising, imagine bringing your hip forward along with your shoulders.

Sometimes just realising and correcting your body is enough and soon you’ll get the hang of it!
No stirrup work, riding with only one hand, and no rein work.
Maybe try some no stirrup work, if your leg stays in the correct spot then it will be harder for you to lean forwards or backwards in your seat and you can get used to how the correct center of balance feels and start feeling for it better, hope this helped!