Moses had access to Egyptian libraries while growing up. Presumably these had copies of Mesopotamian histories as well.
um... man was here LONG before writing was invented. Information from the garden of Eden HAD to of been passed down orally