WASHINGTON — Senator Bernie Sanders met with President Obama on Thursday and said afterward that he would do everything within his power to stop Donald J. Trump from becoming president — and would work closely with Hillary Clinton to make that happen.