President Barack Obama said the rising anti-globalization sentiment in factions of both political parties risks a withdrawal by the U.S. from global economic competition and stymied growth.