If researchers want to record "gender identity" or similar ideologically-driven claims then this should have to be justified. And probably labelled as something more to the point, e.g. "does this individual have a strong desire to be the opposite sex?"
It says that "gender identity" mustn't be used in lieu of sex and that the ideology that underpins it mustn't be promoted.
So if researchers holding datasets which currently have "gender identity" as a variable instead use more matter-of-fact descriptors like "desires to be the opposite sex" then this should be acceptable.
https://en.wikipedia.org/wiki/Institut_f%C3%BCr_Sexualwissen...