Ego has been misunderstood since ages. Ego may be equal to self pride, excessive self pride, confidence, self belief, self assurance or over confidence.

You have ego that you are the best and you strive to be that, the ego is a motivating force in your life.

You have a ego that everyone else inferior to you and you try to crush everyone else without self growth, ego is a regressive force.

In philosophy ego is not same as self pride. Ego there means sense of self. To dissolve that ego is a different aspect of life. No philosophy teaches you to leave your self pride and leave all titles. It only wants you to recognize that self is not real.

How can we transform our ego?

Use ego as a positive motivating force. Try to be a better version of yourself without demeaning anyone else. People who are insecure have ego issues.People who are confident about themselves have only motivating ego issues.