OpenAI and its largest investor, Microsoft Corp., have reached a preliminary agreement about the structure of their partnership, a move that could pave the way for the artificial intelligence startup’s plan to restructure into a more traditional for-profit company.