Alibaba has bought a 10 percent stake in electric car start-up Xiaopeng Motors.