Not certain what you mean by "getting around the law". The 1985 Transport Act demanded that the local municipals and PTE operations were moved to arms length companies. The shareholders usually being the local council though, in the case of Lothian, a number of councils. Any one of them can sell if they wished, AFAIK. There are numerous instances of part sales of municipals.
There was the situation with Burnley and Pendle Transport where the two shareholders were Burnley and Pendle Councils. Pendle Council sold their shareholding to Stagecoach; Burnley council announced they would not sell but then a year later, reversed that decision.
Leicester City Transport bought Trent's Loughborough operations. Rather than cash, they gave a shareholding in LCT. Hence why even though First own First Leicester, Trentbarton (Wellglade Group) own a shareholding. IIRC, Transdev own a small share (c.5%) of Nottingham City Transport.
However, nothing to suggest that the shareholders of Lothian are thinking of selling, despite apocalyptic predictions of losses totalling fifteen trillion per week*
(* Venezuelan Bolivars)