I’m pretty lucky, even on masteron I don’t notice any shedding.
As far as treating hair loss, I have heard of finasteride and that’s the most common. Just have to watch what compounds you fun along side it for it to have effect or something like that. I think it has bad reactions with certain compounds.
Hopefully someone can chime in with more experience on this. But yeah hair loss is a risk for everyone no matter what. All you can do is try to experiment with treatment and hope it works for you as everyone responds differently