First, read the poem out loud carefully to yourself.
Now, read a line, keep it in your mind, close your eyes, and repeat it to yourself three times. Repeat with every line of the poem.
Now, do the same again, but this time keep in mind the first phrase of the subsequent line for each line.
So you would be saying: "But when the melancholy fit shall fall / Sudden from heaven..." You also know the line is "Sudden from heaven like a weeping cloud," but you are concentrating now on the transition from line to line.
Now you want to look at chunks of the poem, look at them, close your eyes, and repeat them three times.
Now you will want to begin at the first line and see how far you get. Do that a few times. Then start at another point in the poem and do the same thing. You don't want to always start at the beginning because then you'll know the beginning really well and always get stuck later on. Practice the end of the poem more than any other part.
Now you'll want to wait a day or so and try to recite the poem from memory. Re-learn the parts the you've forgotten. Do this several days in a row. For example, I forgot one line of Keats's "Ode to Melancholy" completely. Another was missing several words.