This seems a fair question to modern critics because we live in a culture that does not prize memorization. Instead of rote learning in schools, we tend to emphasize problem solving and research skills. We don't need to memorize because we can look things up. All hail the Internet!
However, two thousand years ago, the Internet didn't exist. Libraries were not terribly common. People learned through memorization. In fact, before students were even allowed to start asking about a text, they had to memorize it. Memorization was a skill learned early, and practiced throughout one's life. And this skill would have enabled events to be recorded much more accurately after some space of time than if we had to rely on it today.
Even in our time of little memorization we know that certain "helps" can assist in memory. We know, for instance, that using songs helps memorization. There are also many tools, various mnemonic devices that can aid people in remembering things long-term. And of course, people remember much more clearly when the event in question had a large impact on their lives. If these things are true today, how much more effective would they have been in a culture that prized/used memorization to pass along their entire cultural history?
In essence, memorization skills would have enabled the Gospel writers to have remembered events sufficiently to record them accurately enough (I'm leaving out the help the Holy Spirit would have provided as that would be akin to proving scripture's historicity by internal claims instead of other forms of evidence - but I think the Spirit definitely played a part.)
But we also have more than cultural importance of a culture that prized memorization skills. Paul, for instance, pass along what was passed to him. Creeds were used to communicate elements of faith, and would be easy to remember. There are some 41 creeds in the NT, evidence that such methods were used.
Additionally, it is not necessarily so that the Gospels were the first recordings of Jesus' life. Luke mentions other endeavors to record Jesus' life, and there are scholars all along the spectrum from conservative to liberal speculate that there were other written sources on which the Gospels themselves depend. It is likely that the Gospel writers didn't even have to rely on memory.
But in case they did, I'll return to my initial point and quote this from Dr. William Lane Craig:
"In an oral culture like that of first century Palestine the ability to memorize and retain large tracts of oral tradition was a highly prized and highly developed skill. From the earliest age children in the home, elementary school, and the synagogue were taught to memorize faithfully sacred tradition. The disciples would have exercised similar care with the teachings of Jesus."
There is no real reason to discount the reliability of the Gospels as trustworthy based on any reliance on oral transmission of history.