Generally speaking, melodic memory is like any other "type" of memory. We improve it by using mnemonic and "chunking" techniques, by getting more familiarized with the subject matter and, definitely yes, by practicing regularly.
By "chunking" I refer to any kind of approach where you memorize a single property of a group of items, rather than each individual item (like "first 10 letters of the alphabet, rather than a-b-c-d-e...).
Familiarity is also important. It's much easier to memorize an arbitrary list of first names in your mother tongue than in a language that's completely foreign to you.
So in a way, although I understand what your teacher is trying to say, and I agree that trying to memorize the melody is important, I don't agree with completely separating memorization ability from the dictation ability it self, as most of the skills required for dictation are also required to be able to memorize an extended melody.
Again, a daily life example, you'll have no trouble at all in memorizing a normal sentence in your language, but it will be much more difficult memorizing the exact same letters in a totally random order.
So, in melodic dictation, what are the "words" that can be used to help us memorize/recognize the notes?
Most melodies don't have completely arbitrary sequences of notes (not all the time any way), they usually are made of segments that follow specific patterns, with an interval leap here and there.
So, when you're trying to memorize a melody, it helps if you look out for patterns that can easily be recalled, namely scales, arpeggios, and other common sequences.
Familiarity with all intervals is of course critical, as is scale degree identification within a tonality (e.g., given the tonal center, know when you hear a specific degree of the scale).
So, to give an example, if you have, in C major, a melody like "C-E-G-C-B-A-G-F-E", you can identify an arpegiated major chord starting on the tonic, followed by a descendant diatonic scale down to the mediant ("third degree"). This knowledge need not replace the "audiation" memory you may have of the melody "in your head", but both types of memory reinforce each other.
Of course not all melodies are made purely of scales and arpeggios, and it helps to practice with some simple patterns (e.g., with scale degrees, 1-2-4-5, 1-3-4-5, 1-4-6, 1-3-2-4-3-5-4, etc.,etc.). It's not possible of course to memorize all possible note sequences, but with time you'll recognize more and more and it will become easier to instinctively identify unfamiliar ones.
BTW, an excellent (and completely free!) resource that can complement what have with your teacher and that will allow to practice alone in a progressive way is the Musical Dictation: Tonal Ear Training website, from the Canandian univerity Cégep Marie-Victorin. They provide for download a full set with literally hundreds of dictations that follow a progressive schedule, for example, the first level:
- 1 The pentachord
- 2 The tonic chord
- 3 Tonal attractions
- 4 The upper tetrachord
- 5 6-7-1 motion
- 6 The dominant triad
- 7 The dominant 7th chord
- 8 The dominant 7th chord without root
- 9 Melodies containing stepwise sequences
As you can see they introduce different types of common patterns, little by little.
So, to summarize, melodic memory, ear training for melodic dictation and ear training related to music theory are not skills that can be compartmentalized from each other, but must be practiced in a coherent way. If you have difficulty with longer melodies, keep practicing with smaller segments, but trying to recognize "the language", not just trying to repeat in your head the sounds you've heard. Keep practicing recognizing intervals, tonal degrees, scales and arpeggios and other simple patterns. Increase the difficulty in a gradual way, and, as commented Todd, practice daily