Ferrari and Mercedes are among automakers turning to companies such as electric motor startup YASA to help them overcome problems as they move toward electrification.