While you could say the piece is in A minor, it doesn't really use the tonal ideas brought from the common practice period. If it did, you would see E or E7 much more instead of Em. The piece builds more off the naturally constructed chords of the A minor scale which means it uses much more modal ideas and I wouldn't expect certain tonal ideas, like the deceptive cadence or modulation, to actually drive what's going on and the are other things going on. The melody is is direct control of the harmony.
There are things you could look for and study. In general inside or outside functional harmony, look at how the notes move and you'll see patterns. For example moving up a third such as Em to G and Am to C are common ideas in this and can be looked at not as functionally, but decoratively. Functionally not much is changing If we were to combine those two chords for each we would end up with Em7 and Am7 respectively so in part when these chords are used with each other they can more or less be viewed as one unit moving for effect due to their similarities.
For the D chord it's just a borrowed chord from a parallel mode most likely from A Dorian, but it can also be viewed as from A Major (or Ionian if you're thinking modal). It's no different from iv and in major keys you'll sometimes see the opposite where iv is used instead of
IV. In this piece, it's just use to give a little bit more resolution to when you go from the D to the Em as the F♯-> G resolution is stronger than an F->G resolution. It also sets up the next part quite nicely.
The next part even if you try to view it functionally does not modulate. Different chords are used to color the melody which is different then before in a much way that has been done before, but it does not stay and you quickly return back to where you feel A is the most important note again and arguably you never left.
So in short this piece is not from functional harmony, but modal instead so you need to look at it much differently to understand it. Roman Numeral analysis will not get you far, but you can look for how the harmony moves and look at the melody to get a good perspective of why the harmony is the way it is along with melodic and harmonic patterns (motifs) that may define the piece much more than a functional analysis can.