Tesla will sue you for $50,000 if you try to resell your Cybertruck in the first year
(www.businessinsider.com)
If they simply forbade resale, it would be an unenforceable term. The obligation on them to buy it back (at an agreed price) in order to enforce the term likely makes it legal.