To know when an ego is emerging, we have to observe ourselves. Identification is constituted by a state in which we feed that given aggregate within the moment of its emergence. To stop identifying is to not to feed it with our psychological energy, or our investment within that particular identity in a given moment. This means to not direct our consciousness through the will and identity of a given defect. This is a subtle and difficult process to understand, which is in itself the work of the transformation of impressions, transactional and structural analysis, as well as counter-transference as described in
The Revolution of the Dialectic.
In truth, we develop many egos when entering these studies, egos that comment, "An ego is approaching!" To detect these thoughts, we must observe, since due to our inexperience, we fashion many aggregates that comment about the mind, which in themselves are products of the mind. To overcome this problem, we must observe these elements in action and meditate on their destruction.
To succeed as an observer of the observed, we need energy. This requires that we transmute our sexual energies, so that we have the power of perceive our mind in action. To perfect this process of observation takes great trial, experimentation and difficulty, but with practice, the faculty of self-observation develops marvelously within our interior in conjunction with our work in sexual transmutation.
When an ego is emerging or is trying to take over, relax and observe. That's it! Observe it, so that when you see it emerging, you learn how to not act on it psychologically. That is the next step.
If you feel an emotion like anger taking over, relax and breathe. Samael Aun Weor provided an exercise for controlling anger in Introduction to Gnosis, which simply has the disciple breathing in for six seconds, retaining the breath for six seconds, and exhaling the breath for six seconds. Relax and be at peace. Observe. Learning not to identify with the mind is a great battle, but one that is overcome through the interior state of peace, which makes any initiate truly indestructible.
If you watch martial arts like Judo or Aikido, you can see that the most experienced practitioners are very relaxed. In a state of peace, they are able to throw, lock, pin and disable opponents with great skill, all within a calm state of mind. This is what we need in relation with the dominion of the mind: self-observation and comprehension of one's internal states in the moment. To do that, we must comprehend where we are in a given moment psychologically and not worry about the past of the future!
The best act of worship is watchfulness of the moments. That is, that the servant not look beyond his limit, not contemplate anything other than his Lord, and not associate with anything other than his present moment. -Al-Wasiti, quoted in Al Risalah: Principles of Sufism