The chief legal and administrative officer of TuSimple Holdings, a developer of self-driving technologies for trucks, is leaving the company just as its legal challenges heat up.