Answering this from a Biblical Unitarian perspective that holds Jesus 'pre-existed' his birth only in the sense that he was part of God's plan.
The text is pretty difficult to understand here.
In the article Philippians 2:6-8 the authors conclude
"The verse is not speaking either of Christ’s giving up his “Godhood” at his incarnation or of his God-nature being willing to “hide” so that his man-nature can show itself clearly. Rather, it is saying something else. Scripture says Christ was the “image of God” (2 Cor. 4:4), and Jesus himself testified that if one had seen him, he had seen the Father. Saying that Christ was in the “form” (outward appearance) of God is simply stating that truth in another way. Unlike Adam, who grasped at being like God (Gen. 3:5), Christ, the Last Adam, “emptied himself” of all his reputation and the things due him as the true child of the King. He lived in the same fashion as other men. He humbled himself to the Word and will of God. He lived by “It is written” and the commands of his Father. He did not “toot his own horn,” but instead called himself “the son of man,” which, in the Aramaic language he spoke, meant “a man.” He trusted God and became obedient, even to a horrible and shameful death on a cross."
The logical conclusion from this perspective is that there was no specific moment this happened. Rather, it was an ongoing process, presumably beginning as Jesus began to become aware he was the Messiah, and it culminated with the death on the cross.
The 'emptying' was repeatedly renewed or ongoing, as his prayer in Gethsemane indicates, "Father, if you are willing, take this cup from me; yet not my will, but yours be done." (Luke 22:42).
Q: So are you saying that he emptied himself in a psychological way over a long period of time so to speak? He was brought up to believe that he was the Messiah, and then he sort of had to fight against the pride and remain humble, like a psychological battle against the pride of knowing that he was the Messiah?
A: I wouldn't say he was brought up to believe he was the Messiah (it's certainly possible, but the texts don't say), but he would have had to have an inner realization he was the Messiah. This coincided with accepting the plan God had for him, which was to die on the cross and then be raised and ascend to rule. So yes, it was an ongoing process of psychologically 'dying to' his own ego. This seems to be what St. Paul is talking about (Phil 2:12 and on going) in the application of these ideas to his audience in his letter.
Q: Thanks for offering a fascinating statement : "Jesus began to become aware he was the Messiah". - Where would this moment occur in scripture?
A: He clearly realized it at some point, but I don't think scripture says. Luke 2:40 and on gives a clue. Perhaps when he was quite young.
Q: Given the various events that had happened to Mary and Joseph, surely they would have told Jesus about these as he grew up and so raised him as the Messiah?
A: I agree it seems likely Jesus would have been told some of these things, and he could have been raised as the Messiah in some sense. Yet, he would have had to come to an inner realization - not just from his parents telling him, but from God telling him.