Identities are formalized based on observation of an Other who doesn't fit into the category, because those observations bring to light unstated assumed commonalities between peoples who didn't think of themselves as a single thing. This is one method of ethnogenesis where groups that didn't think of themselves as a thing gain that consciousness. The idea of "white people" is an example of ethnogenesis that I think had its origins mostly in the American colonial experience, where you had a mixture of European groups differentiating themselves from Africans and American Indian groups. In Europe, an Englishman and a Frenchman (themselves the result of their own ethnogenesis) may not see eye-to-eye, but in a new territory with other peoples with very different cultures, suddenly the English-French thing doesn't seem as big.
These things expand, shift, and contract over time. But at the moment, the consensus-driven model makes me see myself as "white" as one of my categories, invented or not (not that that's my sole identity or anything!). I see myself as white, others who I see as white see me as "white" (though probably if outside the US they see me as "American" more?), and others who aren't white probably think "white" when they see me, so in the end that's the category that we have at the moment, nothing wrong with that in and of itself as long as you treat others with respect.
I hear that "Imagined Communities" is a good read about the rise of different nation-feelings in recent centuries: https://en.wikipedia.org/wiki/Imagined_Communities I haven't read it yet myself, though.