I've run into quite a few women in STEM and almost all of them have a deeply personal reason for getting into the market they get into. I know a programmer who got into programming because she was dissatisfied with how nothing was made to work the way she imagined it could be in games so she essentially taught herself from the ground up. A lot of science majors are either following in a parent's footsteps or have a personal experience that drove them to it.
Easiest way to sus out a tranny is their reasoning behind it. Trannies (and most men) will give a simple answer such as enjoying the subject or whatever it may be, women will give a complex one and usually have a story to go with it. Not to say it's foolproof, but women are also used to having to defend their choice from judgment so they're almost always prepped with a story to stop any questions.
You can also tell how knowledgeable based on whether they begin to explain or if they just get offended when you ask questions. There are "women in STEM" who don't contribute anything and are data entry diversity hires for big companies. They're often very aggressive about their position but have nothing to show for it other than flexing about their job. I don't really count them because they're a different breed and have poisoned the well for the actual women who have worked for their place in the industry.