Two-stage games of endogenous fiscal coalition formation: institutional design of stabilization policies and the accession to a monetary union