O'Brien was probably trained as an engineer right after graduating from whatever "basic training" Starfleet non-coms undergo when they enlist. Though O'Brien's background is a bit murky, since he's been a tactical officer, a field soldier, and an engineer. I suppose Starfleet non-coms would be cross-trained in all those disciplines though.
O'Brien wasn't just a simple button pusher, though. As a transporter operator, he was also responsible for maintenance and repair of the transporters. As such, he was under LaForge's command. So, no, he didn't need to be re-trained before being assigned to DS9, since he was always an engineer.