the way i did it was to take a bi test. when the pie chart showed up i waited for my mom to come in the room, and i showed her that, saying right afterwards "so i guess i am bi." she then said "cool," and then i said "well i guess i'm not in the closet anymore."
i would say before even that, bring up LGBTQ+ topics with your parents and see how they react.
if it's a positive/very positive reaction, you can safely come out of the closet.
if it's neutral, i recommend to stay in the closet, however, you can come out, but be careful.
if it's negative/very negative, then 100% stay in the closet
only exception is, instead of saying that you're bi, say what you are (in this case, gay and transgender).