Hi! 初めまして!
I guess you are referring to the example sentence ‘覚えるんです’. If you look at it closely, you will see that 覚える still works as a verb and that んです (the subject of this grammar point) is attached to the verb to give emphasis to the statement ‘覚える’ (I will remember), adding the nuance ‘it is a fact that I will remember’ or ‘The thing is that I will remember’.
In fact, this is the exact same usage as the last example, ‘忘れるのです’ (‘it is a fact that I will forget’).
HTH!