  Topology and generalized symmetries in the $SU(N)/\mathbb{Z}_N$ gauge theory
are considered in the continuum and the lattice. Starting from the $SU(N)$
gauge theory with the 't~Hooft twisted boundary condition, we give a simpler
explanation of the van~Baal's proof on the fractionality of the topological
charge. This description is applicable to both continuum and lattice by using
the generalized L\"uscher's construction of topology on the lattice. Thus we
can recover the $SU(N)/\mathbb{Z}_N$ principal bundle from lattice $SU(N)$
gauge fields being subject to the $\mathbb{Z}_N$-relaxed cocycle condition. We
explicitly demonstrate the fractional topological charge, and verify an
equivalence with other constructions reported recently based on different
ideas. Gauging the $\mathbb{Z}_N$ $1$-form center symmetry enables lattice
gauge theories to couple with the $\mathbb{Z}_N$ $2$-form gauge field as a
simple lattice integer field, and to reproduce the Kapustin--Seiberg
prescription in the continuum limit. Our construction is also applied to
analyzing the higher-group structure in the $SU(N)$ gauge theory with the
instanton-sum modification.
