Review consistently for journals in your field, be on time w/ reviews, do a good job and don't be a jerk and they'll likely ask you eventually. On the back end know that some journals ask editors to rate the quality of reviews and many, if not all, keep track of review metrics (time taken, number of reminders sent, number of reviews refused). It's also much easier to get invited if you establish yourself as an expert in a subfield through your own published work. Also, if you review a lot for the same journal you can ask to serve on the editorial board. I know several people who have had success doing this and it's now what I recommend to our junior faculty.
In my experience, this is one of those things that after you get invited to your first editorial board, others follow pretty swiftly. Some of this is also based on who you know. As your cohort moves up in ranks, it's likely that you'll have friends and colleagues serving in AE capacities begging you to review and recommending you for these things! Keep in mind being on an editorial board can be a bit of a pain. But, it's good for promotion and tenure so my final bit of advice is to let others in your department/research world know you are looking for these opportunities -- Now when I am asked to serve on an editorial board I typically pass and suggest a respected (most of the time junior) colleague. But, I only do this if I know they are interested because I am not trying to give people extra work and I personally hate when people volunteer me for things without asking.