Good question. "Memorize" is actually not a formal word. We use it in normal, everyday, casual English. There are alternatives, but "memorize" is the most common word, by far.
But, since you asked, some other options:
"Learn by heart" is another way of saying it:
"The couple should've learned their vows by heart."
Another option is "to get something down pat":
"I've got my lines down pat, I'm ready to go on stage!"
This is very informal and American; it can also be used for a skill, not just for something to be committed to memory.
Like I said before, "memorize" is the best option in any context!