Mapping class groups and the monodromy of generalized period maps