President Trump has instructed advisers to prepare a withdrawal from the free-trade agreement, several people close to the process said, a move that would stoke economic tensions with the U.S. ally at a time both countries confront a crisis over North Korea's nuclear weapons program.