San Miguel de Allende, Guanajuato: historia de su fundación