The United States and China have to lead the way in the fight against climate change, former US president Barack Obama says.