Re: land transfer
If it's a blanket ban on selling, it's a restraint on alienation, and falls foul of the law. As such it would be void, and the recipient of the property could ignore the restriction (but still take the property). More limited restrictions may be valid (e.g. if you sell within 10 years you have to give 10% of the proceeds of the sale). It's a matter of degree.
If you're thinking of inserting such a condition in a transfer, you need a competent conveyancing solicitor for advice.