It is similar to the issues surrounding Intersex people in top-level athletics.
The Caster Semenya debate
It is complicated but setting upper limits for testosterone levels in transgender female athletes is one possible solution.
I really doubt that anyone becomes transgender just to have an athletic advantage. There have been cases of men trying to present themselves as women to gain athletic advantage, but that is not at all the same thing as being transgender, just as wearing drag to a costume party does not make a man into a transgender woman.
ETA: Slate has the clearest writeup of the intersex athletics issue that I've seen:
Should Caster Semenya Be Allowed to Compete Against Women?
Biologically, a Transgender woman (with testes) on hormone therapy is probably very similar to an intersex person who may identify as either gender or no gender or whatever the person wants to identify as. A transgender woman who didn't begin hormone treatments until adulthood may still benefit from increased bone density, but the hormone treatments will prevent excessive muscle buildup. Testosterone is the key. I don't know what limits can or should be placed on testosterone levels for female athletes, but the simple fact that it can be measured suggests that there may be scientific answers to the dilemma of transgender or intersex women out-competing cis-gender non-intersex women in athletics.