How did Moses write the events which happened ~2000 years before him? Except the book of Genesis, I believe that it is possible to make some plausible possibilities on how the books of the Bible were written. Moses wrote about himself, Joshua recorded his conquest of Canaan, some priests or prophets recorded the stories of Gideon, Samson and Ruth. Samuel recorded the events in his lifetime, historians recorded the chronicles of the kings of Israel, prophets wrote down their visions and messages from God, the apostles recorded the life of Jesus, apostles wrote letters and John wrote down his visions. 

Now, I can't make any hypothesis how Moses could write down the stories which were around 2000 years before him. The Creation story where no one was there to witness is the most astounding account. Genesis contains many complicated contents such as the years of the first men, thousands of names, complicated family trees, detail stories of people and such.

How have historians and theologians explained how Moses wrote the Book of Genesis?
Pretty clearly, there has to be a mixture of revelation and tradition in Genesis. There are several time periods written about in Genesis, and these should be examined individually:


Creation

Clearly the only observer to the Creation was the Creator. (Or no-one if you are disinclined to believe in a Creator, but from a Christian perspective, no one other than the Creator is even claimed to be present.)  That said, it is not unreasonable to assume that the Creator spoke to Adam about his Creation process, and that an oral tradition would have developed around it.  

Seeing as we exist, and most people are going to ask 'How we came to be' at some point, it is very easy to assume that a narrative tradition would have been passed down at some point. Indeed, pretty much every culture has a narrative myth of some kind - the Egyptians, for example, thought the world was masturbated into existence - passed down from generation to generation.  

Thus the fact that there is a Creation story is not unique.  That the world is created ex nihilo is, however, usually attributed uniquely to the Jews. That alone is a sufficiently startling claim to either be passed down or be something revealed. The startling dissimilarity to other local myths leads many scholars to assume something difference happened to the Jews - regardless of the scholar's status of belief.  This culture either composed something unique or was given a special revelation.  Which it is a clearly a matter of faith in either direction. 
Antedeluvian Period of Cain &amp; Abel, Enoch, the Flood, and Babel

One could ask how we "know" that William Wallace tried to liberate Scotland against the rule of Edward Longshanks.  The paper records are scant, but the story is strong and compelling - much like the tales of Genesis 1 - 12.  Indeed, many scholars see this as a special case within Bible, and so if any part of Scripture is going to be questioned for its historical value, it is this one.  

That said, it is not an impossibility that this faithfully records the witness of the period.  Indeed, the "list of kings" in Genesis 5 bears a striking resemblence to the historical record of the Sumerian kings of antiquity, lending credence to the idea of traditional narrative being passed down. Christians obviously disagree over how to read Scripture as a whole but there is no compelling archeological or extrabiblical evidence in either direction.

Indeed even "dialog" from these Pilgrim and Settler experiences is "documented", in much the same fashion as appears in these stories, showing that tradition can be documented in an "historical" fashion, even if not with the same precision as modern historians can do with modern history.
The Abrahamic Narrative (Genesis 13 - 50)

By the time of Abraham in Genesis, a qualitative difference appears in Genesis.  While 2000 years of history is glossed over in scant detail in the first 12 chapters, the remainder of the book concentrates on just 4 generations of Abraham, Isaac, Jacob, and Joseph.  The events here probably may take place around 1800 - 1700 BC, and begin to take a much more detailed perspective.  Here, for example, we know the names of all the children and the wives.  We learn about their rivalries and their rise to power.  

The situation, from Moses' perspective, would be much more akin to that of a modern American to say, the Pilgrims and Myles Standish, or the founding of Jamestown and Pocohantas.  As part of the founding mythos of Moshe's culture, it is not all surprising that these events would be part of family history, passed down from generation to generation.  And, if Moses lead his people out of Egypt in 1440BC, it would be surprising the history - especially in an oral culture - had not been passed down.  Here, no revelation would have been necessary, as it would have been as common knowledge as say, George Washington "chopping down a cherry tree".  


Thus, in sum, Moshe probably would have relied on a combination of passed on historical narrative and special revelation in order to write about the things that happened before him.  But we do the same things today, so it isn't surprising in the least.