Huh? Why have you shifted to gender identities? The topic was criminal behavior.
In order to study the rates of criminal behavior in different groups, you use standard social science methods of surveying what is out there: understand the base population (including measuring a variety of factors that are suspected to play some role), understand the population of criminals, and observe which factors are associated with what outcomes. We do it all the time with race, poverty, gender, being bullied, previous incarceration, etc. etc.. The only thing missing here is attention to transgender status. Data is lacking; the methods, while somewhat flawed, are good enough to learn more than nothing, and have been widely deployed to do so in many other areas.
If we have a better handle on the propensity to various sorts of violent behavior, both outside of and within prison, then we would be in a better position to understand how to structure incarceration. Of course, if we collect data like this carefully, we would find (not for the first time) that incarceration in many places is an absolute disaster already (with shocking rates of abuse and high recidivism), and if we fixed that disaster, there might not be any residual issue worth worrying about.
(If the topic was understanding gender identities, there's no reason why we can't use standard methods from experimental psychology that we use to probe all sorts of other aspects of our internal mental lives, including things like anxiety and conscientiousness. But that wasn't the topic.)