There are four things whereby a man perfects his memory.
First, when a man wishes to remember a thing, he should take some suitable yet somewhat unwonted illustration of it, since the unwonted strikes us more, and so makes a greater and stronger impression on the mind; and this explains why we remember better what we saw when we were children. Now the reason for the necessity of finding these illustrations or images, is that simple and spiritual impressions easily slip from the mind, unless they be tied as it were to some corporeal image, because human knowledge has a greater hold on sensible objects. For this reason memory is assigned to the sensitive part of the soul.
Secondly, whatever a man wishes to retain in his memory he must carefully consider and set in order, so that he may pass easily from one memory to another. Hence the Philosopher says (De Memor. et Remin. ii): "Sometimes a place brings memories back to us: the reason being that we pass quickly from the one to the other."
Thirdly, we must be anxious and earnest about the things we wish to remember, because the more a thing is impressed on the mind, the less it is liable to slip out of it. Wherefore Tully says in his Rhetoric [Ad Herenn. de Arte Rhet. iii.] that "anxiety preserves the figures of images entire."
Fourthly, we should often reflect on the things we wish to remember. Hence the Philosopher says (De Memoria i) that "reflection preserves memories," because as he remarks (De Memoria ii) "custom is a second nature": wherefore when we reflect on a thing frequently, we quickly call it to mind, through passing from one thing to another by a kind of natural order.
Summa Theologiae 2-2.49.1 ad 2.
ADDED LATER: The Dominican Fathers translation makes some odd translation choices here. 'Anxiety' in the third turns out to be sollicitudo, which explains why Aquinas launches into a brief account of mnemonic theory in his discussion of the virtue of memory: memory is a 'constituent' part of prudence, and solicitude/watchfulness/care (previously the translation has translated sollicitudo as 'solicitude') is a property of prudence. Thus the third way is based on a property of prudence. The 'reflection' of the fourth way is meditatio. Indeed, all four of these things are things that prudence has to be doing all the time in one way or another when we are making moral decisions. On their own they are not enough to yield prudent decisions, but to be prudent we need to assume appropriate likenesses (think analogies) of the good, orderly thought about the good, solicitude or care for the good, and meditation on the good, or to put it in a different way, analogies of the good drawn from experience, an orderly perspective on how our experience and past actions relate to the good, close attention to our experience and past actions in light of the good, and meditation on how our past actions involve the good. Each one of these could bear its own discussion, I think.