https://en.wikipedia.org/wiki/Accredited_investor
In the United States, to be considered an accredited investor, one must have a net worth of at least $1,000,000, excluding the value of one's primary residence, or have income at least $200,000 each year for the last two years (or $300,000 combined income if married) and have the expectation to make the same amount this year.
There are rules against that, intended to protect small fish against being ripped off by strangers. Small fish are assumed able to judge their family and friends, and big fish to be able to take care of themselves.
Would a sale between unrelated persons be regulated? For example between a stranger and a confirmed ex-employee with stock? Does one have to be an "accredited individual" for any outside stock transaction?
A sale isn't forbidden, but soliciting is. SpaceX cannot solicit the general public. If they can explain that they reached you because you're Elon's former secretary's cousin and you met Elon at a birthday party, they may choose to include you in a financing round. Otherwise, they'll just say no, because you're not worth the risk/cost of having to answer pointed questions from the regulator.
(The regulator might not punish them, but just having to answer questions quickly eats up expensive lawyer hours. And then there's the whole question of who you are. If you're a shareholder you're entitled to answers, so pedants owning a single share can be a real bother.)