Yes, it certainly would! Transform will turn Ditto into the same type as your opponent with the same moves. This means that your Dragon moves will be powerful and super-effective against them, but their Dragon moves will also be super-effective against you!
You'll need to have a high level Ditto still. And don't put it out first because Lance's first pokemon is Gyarados.