That’s a common criticism of the movie, how he knows he has amnesia if he has amnesia. But he states in the movie, he can “learn” things by repetition, and he becomes conditioned to that. So that explains how it’s possible for him to know he has a condition.
There are tons of other theories out there as well (you don’t want to know how much I researched on this movie) but yeah, I think an explanation for that criticism is in the movie.