Bogoliubov excitation spectrum of an elongated condensate throughout a transition from quasi-one-dimensional to three-dimensional