Do you do groundwork with her? If it were me, I'd focus on getting a nice trot online without her breaking into canter. Also, it's helpful to have consistent cues for the different gaits, whether groundwork or under saddle. For example, Sonny knows that one cluck is walk, two clucks is trot and one smooch is canter. Once he appeared to consistently understand those , I taught him the words, walk, Trrrot, Cannnter as well. Of course, always use your body, energy, legs and seat as well , both with groundwork and riding. Acutally , the verbal cues should be a backup, imho...something I'm still working on, I forget and depend too heavily on clucking and smooching, etc.
Anyhow, once I had things solid with groundwork, then I'd ask for walk , trot, canter if youre ready, riding.
OK, so if you ask for trot and she canters instead? Get a vet check,,,make sure her teeth are in good shape (Sonny prefers canter to trot when it's time to have his teeth floated...his way of telling me that the trot is too jarring with a bit in his mouth, I can only guess...but he's gone back to trotting when asked after his teeth were done,,on more than a couple of occasions. Make sure the saddle fits,,,maybe it's pinching and she's trying to run away from pain. Vet should be able to tell if it's a hock issue, etc. Or..you could go ahead with the vet check now if you havent already done that.....
Once you're as sure as you can be that it's not a physical issue.....when she canters instead of trotting, I'd calmly but firmly slow her down and try to get trot Vs walk or halt, as posted above. IF you get even only 1 or two trot strides, halt her and praise,praise! Build from that.
If that doesnt' work...is there a friend who can ask for trot with a line on her, do the groundwork as you do (same cues) to get trot while you are riding? ...gradually switch to you cueing for trot Vs the person holding the rope...?
Also, since you don't know how the previous owner rode her,,,,could it be that she wasn't fully broke/trained...maybe she is unbalanced or doesnt' realize that she can trot with a rider and canter is easier for her. She might need a trainer to finish her.
Could you get a video posted ?
Keep us updated on how it's going.