How do you become a referee for a math journal?

Generally, you would publish in Journals, and the Section Editors will descend on you like vampires in search of fresh blood asking you to do reviews.

If you have trouble breaking in, talk to a mentor, and ask them if they can recommend you to the section editors (in place of themselves) for any refereeing jobs that are really up your alley.

I am not in math, but as far as I know the ways to become a referee are pretty consistent across fields. In my own field, referees are chosen by editors through some combination of the following categories (in no particular order and of course these can overlap):

  1. Authors who have published in that journal in the area of the submitted paper

  2. Authors cited by the submitted paper who do related work (also more generally people who publish in that field; this depends on how familiar the editor is with the specific field and whether they feel qualified to identify the right people)

  3. Referees suggested by the authors of the submitted paper upon submission (some journals request such a list explicitly)

  4. Past referees the editor has worked with and had a positive experience

  5. An invited reviewer doesn't want to review the paper and suggests someone else. This is perfectly fine if it goes through the editor, however sometimes a busy professor might present it as their own review but it's actually written by a graduate student or post doc, but I find this unethical.

(4) doesn't really apply to you if you haven't reviewed in the past; (1-3) aren't really things you can influence besides publishing in the area in which you are qualified to review, which you're doing anyways (right?). (5) is a possibility.

If you want to increase your chances of getting selected as a referee, I suggest improving your visibility in a few ways. Editors use many sources to get referee names, some of which you can control.

Make sure you are visible on the internet, and that it is clear what are your areas of expertise. An editor may well look to names listed in a paper's references or try names suggested by an author or some other mathematician declining to referee, but before sending you email they likely will verify who you are and what sort of mathematician you are. If you are hard to find you may get passed over.

Many (most?) mathematics journal editors are ordinary professors, and you will meet them in conferences. If you ask questions at talks, and more generally show interest in mathematics not directly related to your latest research, then your name might stick in their mind. Make sure to attend conferences, even virtually, assuming that you are able to do so. The list of attendees at a conference where an author presents is an obvious list of candidates.

I agree with @Scott Seidman that it might be worth mentioning to someone like your PhD advisor and let them know you would be interested in refereeing. Editors tend to overwork the names they know, partly in hope that the person they know will suggest a younger name the editor did not know.

In summary, it is about networking, which can help your career in many ways. Just be careful, or you will be asked to organize conferences, referee papers, serve on editorial boards, serve on funding panels, and too much of that is a problem early in your career.