It is challenging, but doable. Both the new and the old systems must use the same email client program. You then find the location of the files and drop the old email into the proper location on the new pc.
I can document only Thunderbird (TB) but it will serve to give you a starting point.
The TB data is stored at: