Learning Macroeconomic Policies based on Microfoundations: A Dynamic Stackelberg Mean Field Game Approach