I think that the ego is made up of the overlapping imprints of other people and other beings onto our first person consciousness. We then imprint upon everyone else we interact with.
My articles "Death, Amnesia and the Nature of Subjective Aliveness", and "Overlapping Reincarnations" outline a philosophical perception of an afterlife that wouldn't require any woo-woo beliefs, because it is exactly the same as the life we are living right now, seen from a different perspective.
It boils down to:
1. There is no such thing as an experience of unconsciousness. Therefore there is no experience of death from the "inside" as it were. Consciousness always feels continuous.
2. Our personalities, our "egos", are comprised of overlapping imprints of everything that we encounter. In turn, we imprint upon everyone we encounter.
3. Since everything in the universe is made up of matter/energy, and energy takes the form of waves (including the energy of "imprinting"), the subjective experiences of what it's like to have a particular ego can be seen to form recognisable recurring patterns across history. This is what archetypes are. It's why we can relate to people from history, certain celebrities, or even fictional characters, let alone our loved ones.
4. Thus it is possible for someone to look at their own life, and someone else that has a very similar subjective outlook on life, and say "that is me in another life". Because what is the feeling of "being a particular person" but a set of emotions, beliefs and outlooks on life? Apart from specific memories, that's what personalities are.
I explain it more in my two articles mentioned above:
Death, Amnesia and the Nature of Subjective Aliveness:
https://ladyreverie.medium.com/death-amnesia-and-the-nature-of-subjective-aliveness-7d19c254f5f
Overlapping Re-Incarnations
https://ladyreverie.medium.com/overlapping-re-incarnations-dcd852698228