We are told by ‘popular history’ that mankind spent thousands of years passing on historical stories by word of mouth and by implication would include exaggeration and legend.
The first part of the Bible is included in this assumption, but looking at Genesis 5:1 we see it differently, because it states: …
“This is the written account of Adam’s line…”
‘Written account’ is a written document.
There is every possibility that Adam from the very beginning kept records of passing days and years and other things.
The Mangyan tribe in the Philippines used wood to carve their script on and the ancient Tamils of South India used leaves.
Neither of these things last very well but they would have been freely available for Adam to use.
Perhaps Moses had lots of aging, deteriorating documents that he was able to read and then from those, write what we now know as Genesis.