I am obviously not an expert on this subject. If I had to guess though...
High School has always had its societal rejects. Nerds. Loners. Druggies. Even just ugly looking people.
Alot of those kids over the years have been made fun of just for not acting / looking like something that society believes is an ideal model. I suspect that a decent chunk of these kids are seeing the acceptance of "alternative lifestyles" and have latched onto that as a possible escape. In the end, we all want to be loved in some fashion, and seeing that there is a group out there that acts differently than the societal norm but doesn't let the bullying / rejection affect them is appealing to that individual. Maybe they truly feel the way that group feels. Maybe they are going with the "fake it till you make it" system (trying to convince themselves that they can fit into that sub-society).
It's not going to be a black-and-white situation though. Through whatever biology or upbringing that individuals get, there is rarely going to be a time where you find a group of other people that you fit in with completely and ideally. You try to do your best to find the group of people that "gets you" the most. I think the rise in number is mostly just due to the fact that it simply hadn't been an option before. The backlash had been too great to the point where those sub-society members (and I mean that as a sub categorization, not as a denegration) didn't have enough acceptance to make their beliefs public. As it has become more mainstream, the shame has decreased and the reluctance of others to join has also decreased accordingly. These kids may eventually figure out that what they truly want no longer aligns with this group they identified with. It happens. People grow. People change.
As I noted above, I'm against kids making biological changes until they are old enough to know for sure. You can be open to them exploring the options before then, but it is something you shouldn't force.
There are alot of times when the world really sucks. It's kinda a fact of life. We all are looking for individuals to share the burden with.
The point that made me go 'not bad' in this kind of discussion previously was the left handed one. Admittedly I'm a messed up left handed to where I write, eat, play pool left handed but shoot (basketball, not guns), throw, bat, play guitar right handed.
Anyway the response is based on restriction control impacts. The analysis states something to the point of in 1930ish, early 1900's only 3% of people were left handed.
That was also when schools forbade it and forced everyone to learn how to be right handed.
When that barrier was lifted, immediately left handedness exploded up to something like 12%, which stayed around that percentage since.
The point being the increase in left handedness wasn't from people choosing to be left handed, more that 12% of people were always naturally left handed but were forced in our society to be right handed.
Anyway that's kind of where the gay, trans % number discussions tend to be the core argument, belief that it's always been true and it's our moving to natural acceptance or the belief of belonging that has allowed for the data to be what it is believed to have always been.
Sure, there are attention whores at every age group so I do believe that some kids do it for social attention but, overall I'm more a believer that the gay, trans percentage was likely underrepresented because of how detrimental in society it was to be labeled gay or trans.