I'd say the safe way is cardio, some more cardio, and a bit more cardio. While you're on HRT, the muscle gain from exercising will be less pronounced, especially if you don't consume a large quantities of protein. Doing your cardio with an exercise that has less intensity for your legs and more whole-body, like swimming will also help, although it might increase the muscle mass on your shoulders. Still, the antiandrogens in your system should make it harder for you to gain muscle than ciswomen, because they have active testosterone even if it is on average 15 times less than men's.
I don't recommend this, but I heard about it recently:
There's a pretty new surgery in vogue in South Korea, where the girls get their leg muscles reduced. Apparently, many of the young women there are wearing high heels so much that they have began to develop pronounced leg muscles from the strain of wearing them. Because they don't find it aesthetically pleasing, and don't want to stop wearing heels, they pay a surgeon to excise some of their muscle from their body.
Hugs,
- Katie