Entanglement and the Born-Oppenheimer approximation in an exactly solvable quantum many-body system