For some kids exploring gender expansiveness may just be a phase, but for some it may not be. If it is insistent, consistent, and persistent, then the child may be transgender.
If they identify as a gender that is not in alignment with their assigned sex than it is unlikely that will change, and most people have some sense of their gender identity between the ages of 2-4yrs old.
It is also fairly typical that gender identity may come into question around the time of puberty which can be confusing for the child as well as their family. While puberty is a time of general confusion it is important to look for patterns that are insistent, consistent, and persistent.