How to get a .edu email address as an independent mathematician?
Of course, becoming a student or staff member is one way to get a university email.
Some institutions provide alumni email.

Many universities have various unpaid affiliates. Such affiliates are sometimes eligible for a  university email. However, such affiliates are often expected to contribute to the school, faculty, or university. For example, you might publish with the university as your affiliation or you might give occasional lectures or you might supervise a research student. These sorts of affiliations are typically obtained by building up a relationship with some academics in a given department and making enquiries.