Tesla plans to build its Model Y compact sport-utility vehicle in China, in a move to expand the company’s capabilities as it seeks to grow in the world’s biggest auto market.