I came to this conclusion back in high school by just observing my workaholic father and grandfather. They when asked about themselves would talk about their job first. My grandfather gave everything for his employer moving around the country for his employer. In they kicked him to the curb when they felt the financial squeeze just a few years his before retirement, never mind he had devoted his life to them sacrificing his family life to them. And worked for them for over 40 years. My father is from the same bolt of cloth you ask him about himself and he starts talking about his job and what projects they are working on. When I was growing up he worked 80 hour weeks, now that his children are grown he work more. He deals with depression and burnout but is to afraid to quit. He complains of loneliness and lack or friend but spends all of his time working and is afraid or retiring even though stress from his job is killing him. Neither of them could see themselves separate from their occupation. Neither really got to do their hobbies or have a healthy social life or family life Seeing them growing I thought fuck that. I wont be my job and have been happier for it.
I enjoy programming. I program for a living. But, I also have riders on my employment contract that allow me to code outside of work, and enjoy that.
For others, it will be gaming, sailing, anything. The key is to fill that void that your work identity leaves behind with things that you do and control.
In doing so, you take control of your life. I am not perfect here, but because I can balance several different things... none of them control me fully, I control me.
I like the idea of identity including mostly abstract things. Like, for example, if you donate to charities or spend time volunteering, don't hold "philanthropist" as a part of your identity; instead think of yourself as "generous" or "giving".
Instead of a "computer programmer" I think of myself as someone who likes to solve problems or likes to build things. The nice thing about that is it's more flexible, and unlocks creativity and enjoyment in places I don't expect, when I find that I can also solve problems or build things that have nothing to do with computers.
And identity should be a frank evaluation; your identity might include some things you consider negative. That's fine; you might be working on those things, or not, or whatever.
I'm far from perfect, of course. There are still things I consider part of my identity that maybe I shouldn't, because they constrain me or because they can cause conflict. But that's something to work on another day.
[0] https://paulgraham.com/identity.html -- though I disagree that discussions about Javascript don't devolve into religious arguments
It is good to be a little picky. I don't see basing an identity on a professional community as being clever - that community isn't going to do much for its members except maybe help them find a job from time to time.