Although the term generic you is used to mean the you that we use in speech in place of one to avoid sounding like a grammar textbook, it is also used for the you that stands in for I or me.
According to Why People Say ‘You’ When They Mean ‘Me’ at Live Science:
. . . people say “you” to make it easier to talk about
a negative experience, according to the study. In this sense, the word
“you” can, somewhat obliquely, mean “me.”
For example, people may say, “you win some, you lose some,” when they
have just failed at a task, but by using “you” instead of “I,” they
communicate that failure can happen to anyone, not just that
individual, the study said. . . .
Together, the findings suggest that the generic-you provides a way to
“move beyond one’s own perspective” and derive meaning from personal
experiences . . .
The study the article references is at science.org, but there are plenty of others.