I hope it is appropriate to ask this type of question. I'm in my second year as an undergraduate right now. While my problem solving skills have improved tremendously, I almost never tried to actually remember what I learned. I always had the attitude: "If I don't remember it, I will simply look it up." While this might be legitimate to a certain extent (especially when it comes down to definitions), I'm not sure where this leads to in terms of being able to see various connections much faster.
Would you say that it is necessary to remember most of the things that you learnt so far? Of course it wouldn't do any damage at all, but one has always think about it in terms of efficiency, I guess. I mean, it's hard enough to learn mathematics itself - but remembering all of those things just to gain the ability of solving some problems faster? I'm not sure about that and would like to hear your opinion on it.
In my opinion (I completed a Bachelor's a few years back in math), you don't need to memorize all that much. What is worth remembering, imo, is that there is/are theorem(s) about $x$ or about $y$, and perhaps roughly what those theorems say.
For example, I remember from topology that there were a couple theorems relating the Hausdorff property, Compactness, and Closed sets. I'm not sure I could correctly state those theorems right now, but because I remember what they were about, it's not hard for me to find them against if I need them. This is the kind of stuff that's important to remember. The other side of this is remembering good ways of picturing ideas and concepts: this is what helps with being able to see things (quite literally) and noticed connections between things.
It's entirely impractical to try and remember every theorem you will encounter between now and finishing a 4-year degree in math, you will literally prove upwards of a thousand theorems (not exaggerating) over perhaps a half dozen different subjects (or more).
In your actual classes, it is extremely valuable to memorize the definitions so that you will understand what the questions on the exams are asking and thus be able to give a reasonable answer and thus do well on the exam. After you're done with that material though, as long as you remember the names for these things, you can look up the definitions easily enough (warning: not all terms are used to mean one and only one thing, even within a given field of math; example: accumulation point is used sometimes as synonym for limit point, other times for a more general notion, also sometimes called a point of closure).