A generalized Bogolyubov transformation and neutron-proton pairing in nuclei