We study in the framework of relativistic quantum mechanics the evolution of a system of two Dirac neutrinos that mix with each other and have non-vanishing magnetic moments. The dynamics of this system in an external magnetic field is determined by solving the Pauli-Dirac equation with a given initial condition. We consider first neutrino spin-flavor oscillations in a constant magnetic field and derive an analytical expression for the transition probability of spin-flavor conversion in the limit of small magnetic interactions. We then investigate ultrarelativistic neutrinos in an transversal magnetic field and derive their wave functions and transition probabilities with no limitation for the size of transition magnetic moments. Although we consider neutrinos, our formalism is straightforwardly applicable to any spin-1/2 particles.