Make sure to loosen your hips and let your lower body move with the horse. Your upper body is going to move a little, just remain loose and relaxed. Don't tense up if you're moving too much, which is really hard (experience speaking
What's worked for me, which may not be the right way, is to just keep trying to sit the trot until I learn the movement of the horse and how to move with him. He recently started giving me a canter, so I have no advice for that yet.