Do you mean "how" as in "What method do you use to write this?" or "how" as in "What format or medium do you use to write this?" What parts of writing this kind of thing currently seem impossible or difficult to you?
Without more details, I'll just say that some comic books put narration over panels in a very similar way, and if you use a storyboard method to develop your script and level design together, that is even more similar to the examples you can find in comics.
What method do you use to write this.
Well Trine is basically a fairy tale. Okami is another game with lovely fairy tale writing, if you are looking for examples. So the narration would be written the same way you would write a fairy tale. I'm not sure what more I can actually say about how to write a fairy tale, but feel free to ask if you can think of a specific question about how to do that. I've done it, but to emulate a style like that I mostly just read it for a few hours or days and it makes a pattern in my head and I use that pattern to generate my own writing in the same style. You could do it more scientifically with statistical analysis of source texts, but why would anyone bother?
As with comic writing, it's generally better not to be wordy when writing for voice acting. So when revising your first draft you would try to eliminate unnecessary words and phrases. Fairy tales tend to be a bit on the"purple prose" side, so another goal of revision would be to make your word choice sound pretty and remove anachronistic words. You may also want to read it aloud to see if there are any accidental tongue twisters you want to remove.
Once you had a script you'd break it up into small, numbered chunks for recording (assuming you wanted voice acting instead of written text for players to read) and so you could have them be triggered by something the player was doing in the game. If you want a line to be said a particular way, you can always record yourself saying it and provide that as the example for the voice actor.