If you learn that "in-" is a Latin prefix meaning "in" (easy enough) and "e-" or "ex-" means "out or away from" (also easy enough, if you know exit, exodus, egress, etc.), then you will not only be able to remember immigrant and emigrant, but also MANY other English words that begin with those prefixes.
Learning the actual sources of words is a lot more productive than trying to just memorize individual ones or come up with one-shot mnemonics.