Concerning the above issue, Rabbi Mosheh ben-Nachman also known as the Ramban wrote the following in his commentary of the Torah.
Ramban The Introduction to the Commentary on the Torah The Book of Beresheeth
(Translation by Rabbi Ezra Bick with some linquistic adjustments on my part to match more closely the Hebrew text)
Mosheh [ben-Amram] our teacher transcibed this book of Beresheeth together with the whole Torah from the mouth of the Holy One, blessed be He. (Ehav4Ever note: meaning that Hashem dictated to Mosheh exactly what to write)
It is likely that he wrote it on Mount Sinai for there it was said to him, Come up to Me unto the mount, and be there; and I will give thee the tablets of stone and the Torah and the commandment which I have written, to teach them.' The tablets of stone include the tablets and the writing that are the ten commandments. The commandment includes the number of all the commandments, positive and negative. If so, the expression and the Torah includes the stories from the beginning of Beresheeth [and is called Torah - teaching] because it teaches people the ways of trust / following [in Hashem]. Upon descending from the mount, he [Mosheh transcribed the Torah from the beginning of Beresheeth to the end of the account of the tabernacle. He wrote the conclusion of the Torah at the end of the fortieth year of wandering in the desert when he said [by. command of Elohim], Take this book of the law, and put it in the side of the ark of the covenant of the Eternal your Elohim.
This [view] is according to the words of the Talmudic sage who says that the Torah was written in sections. However, according to the sage who says that the Torah was given in its entirety, everything was written in the fortieth year when he [Mosheh] was commanded, Now write this song for you and teach it unto the Benei Yisrael; put it in their mouths, and, as he was further instructed, Take this scroll of the Torah, and put it in the side of the ark of the covenant of the Eternal your Elohim.
In either case it would have been proper for him to write at the beginning of the book of Beresheeth: "And Hashem spoke to Mosheh all these words, saying." The reason it was written anonymously [without the above introductory phrase] is that Mosheh, our teacher, did not write the Torah in the first person like the prophets who did mention themselves. For example, it is often said of Ezekiel, And the word of the Eternal came unto me saying: 'Son of man,' and it is said of Jeremiah, And the word of the Eternal came unto me. Mosheh our teacher, however, wrote this history of all former generations and his own genealogy, history and experiences in the third person. Therefore he says And Hashem spoke to Moses, saying to him as if he were speaking about another person. And because this is so, Mosheh is not mentioned in the Torah until his birth, and even at that time he is mentioned as if someone else was speaking about him.
Now do not find a difficulty in the matter of Devarim (Deut.) wherein he [Mosheh] does speak about himself - [as he says,] And I besought Hashem; And I prayed unto Hashem, - for the beginning of that book reads: These are the words which Mosheh spoke unto all Yisrael. Thus throughout Devarim (Deut.) he is like one who narrates things in the exact language in which they were spoken.
The reason for the Torah being written in this form [namely, the third person] is that it preceded the creation of the world, and, needless to say, it preceded the birth of Mosheh our teacher. It has been transmitted to us by tradition that it [the Torah] was written with letters of black fire upon a background of white fire. Thus, Mosheh was like a scribe who copies from an ancient book, and therefore he wrote anonymously.
However, it is true and clear that the entire Torah - from the beginning of Genesis to "in the sight of all Yisrael" [the last words in Devarim (Deut.)] - reached the ear of Moses from the mouth of the Holy One, blessed be He, just as it is said elsewhere, He pronounced all these words unto me with his mouth, and I wrote them with ink in the book. Hashem informed Mosheh first of the manner of the creation of heaven and earth and all their hosts, that is, the creation of all things, high and low. Likewise [He informed him of] everything that has been said by prophecy concerning the esoterics of the Divine Chariot [in the vision of Ezekiel] and the process of Creation, and what has been transmitted about them to the Sages. [Mosheh was informed about these] together with an account of the four forces in the lower world: the force of minerals, vegetation in the earth, living motion, and the rational soul. With regard to all of these matters - their creation, their essence, their powers and functions, and the disintegration of those of them that are destroyed - Mosheh our teacher was apprised, and all of it was written in the Torah, explicitly or by implication........
Everything that was transmitted to Mosheh our teacher through the forty-nine gates of understanding was written in the Torah explicitly or by implication in words, in the numerical value of the letters or in the form of the letters, that is, whether written normally or with some change in form such as bent or crooked letters and other deviations, or in the tips of the letters and their crownlets, as the Sages have said: "When Moses ascended (Ehav4Ever Note: The Ramban uses the statement (כשעלה משה מרומם) which implies that Mosheh was raised to a type of existance above our normal existance) he found the Holy One, blessed be He, attaching crownlets to certain letters of the Torah. He [Mosheh] said to Him, 'What are these for?' He [Hashem] said to him, 'One man is destined to interpret mountains of laws on their basis.' " '"Whence dost thou know this?' He [Rabbi Akiva] answered them: 'This is a law given to Mosheh on Mount Sinai.' "For these hints cannot be understood except from mouth to mouth [through an oral tradition which can be traced] to Mosheh, who received it on Sinai.