As soon as the user comes into battle, it transforms into its opponent. Broadly, the target's appearance (including form), types, Ability, stats, and moves are copied; the user retains its HP and level. More precise details are at Transform (move) → Effect.
In Double Battles, Triple Battles, and Battle Royals, Imposter will target the opponent in the position directly opposite it. If there is no opponent directly opposite it, it will not transform.
Documentation
https://bulbapedia.bulbagarden.net/wiki/Imposter_(Ability)
Relevant Code Points
Function
0x02256414
needs a new branch for Imposter.