It all depends on what the base move is. For example, if you turn Wild Charge, an Physical Electric type move, into Gigavolt Havoc using the Electrium Z, you would get a Physical move, thus using Physical Attack and Defense Stats. However, if you were to turn Thunderbolt, a Special Electric type move, into Gigavolt Havoc, it would be a Special move, thus using Special attack and Defense Stats. This happens with all attacking moves
Source: Experience and this