The firms will share EV technology as they face slowing demand and competition from Chinese rivals.