I found the best way is to understand the mechanism. I found that the general result of the transformation A->B tends to stick fairly well but remembering the mechanism very hard. By understanding the mechanism (and with many years of practice of churning out mechanisms making it quicker) I could get them down in an exam situation. Better to rely on this than just learning by rote as you never get the perfect example in exams.