Engineering fidelity of the generalized Pauli channels via legitimate memory kernels