I have to recognize I do not know how the militia spell works (I never use it).
I guess its a morphing skill; then, your peasants are removed from the game and replaced by a new unit.
If they are replaced, you can detect when the unit leaves the game. Or when a militia enter the game (since it's an other unit ID).
Otherwise, maybe it works as a unit upgrade (there is an event for this). You can try then to detect the event a unit finishes upgrade blabla.
Last possibility: the building convert the peasant to militia, and not the peasants themselves. Then, you have to detect the order given to your building.