Gender identity is a person’s internal knowledge of their gender – the deep knowledge that they are a man, a woman, or non-binary.
Everyone has a gender identity, including people who are not trans. Men who are not trans, for example, still know internally that they are men. That’s their gender identity. For a trans person before transition, there may be a mismatch between the gender they know they are and the one people around them assume they are.