Hamiltonian formulation of the spin-orbit model with time-varying non-conservative forces