Transforming electrical energy systems towards sustainability in a complex world: the cases of Ontario and Costa Rica