How do you know it's legal? Just because he hasn't been caught?
If Obama did have Trump bugged, it's almost certain that he also would have had the IRS all over him and his businesses looking for Russian ties! They were looking for anything to trip him up.