Magnet is a held item in the Pokémon games. When held by a Pokémon, it raises the power of Electric type moves.
Gold/Silver/Crystal: It can be acquired from Sunny, who appears on Route 37 near the three Apricorn trees (only on Sundays).
Omega Ruby and Alpha Sapphire: It can be found in Route 110.
X and Y: It can be found at Kalos Power Plant.