Deconfinement transition and localization of Dirac modes in finite-temperature $\mathbb{Z}_3$ gauge theory on the lattice