If a Pokemon uses transform,it will transform on dynamax Pokemon but it won't work on gigantamax Pokemon.If it has imposter,on dynamax Pokemon,it will turn into for example:You are battling a Dynamax Orbeetle.You send out a ditto with imposter then, it turns into an Orbeetle that is not dynamaxed.But if you are battling an Eternamax Eturnatus with a ditto with imposter,it will turn into normal Eturnatus.
Source: Youtube