A right of occupancy under any other section than Section 5 shall not be attached or sold in execution of a decree or order of any Court or, without the previous consent in writing of the landlord, be transferred by private contract. ...