There are a myriad of moves and abilities that dismantle this setup in both singles and/or doubles (Good as Gold, Taunt, Neutralizing Gas, Shadow Tag, Encore, maybe Judgement too?) that can be listed off. However, doing so disregards the fact that this gimmick doesn't work unless the opponent outright refuses to attack your Mew, and simply lets you set this up.
In singles, Mew has no way to keep the opponent from switching out their Pokémon, while also needing two turns to Imprison, and then transform into your opponent's Pokémon. This means that, in this time, the opponent has 1-2 turns (depending on its speed) to freely set-up and/or damage your Mew. At best, you'd have gotten away with a free Transform while your opponent is forced to switch out, likely into a Pokémon suited to deal with you. In the worst case scenario, you would've just let your opponent set-up on your Mew and knock it out. It's either that or a defective Imposter Ditto.
In doubles, a similar problem arises. Mew needs two turns to set up Imprison and then transform into the opponent's Pokémon. Except, now there are two Pokémon, which means only one can be Imprisoned. This leaves the other Pokémon to freely take out Gothitelle and invalidate the strategy again by switching out. This is assuming that they don't already knock out Mew or Gothitelle prior to Imprison taking effect.
Overall, the strategy functions like most gimmicks, where it only really works if your opponent doesn't react the moment they know what's coming, among other counters that already exist.