© 2017 American Physical Society. We compute the entanglement between the electronic and vibrational motions in the simplest molecular system, the hydrogen molecular ion, considering the molecule as a bipartite system, electron and vibrational motion. For that purpose we compute an accurate total non-Born-Oppenheimer wave function in terms of a huge expansion using nonorthogonal B-spline basis sets that expand separately the electronic and nuclear wave functions. According to the Schmidt decomposition theorem for bipartite systems, widely used in quantum-information theory, it is possible to find a much shorter but equivalent expansion in terms of the natural orbitals or Schmidt bases for the electronic and nuclear half spaces. Here we extend the Schmidt decomposition theorem to the case in which nonorthogonal bases are used to span the partitioned Hilbert spaces. This extension is first illustrated with two simple coupled systems, the former without an exact solution and the latter exactly solvable. In these model systems of distinguishable coupled particles it is shown that the entanglement content does not increase monotonically with the excitation energy, but only within the manifold of states that belong to an existing excitation mode, if any. In the hydrogen molecular ion the entanglement content for each non-Born-Oppenheimer vibronic state is quantified through the von Neumann and linear entropies and we show that entanglement serves as a witness to distinguish vibronic states related to different Born-Oppenheimer molecular energy curves or electronic excitation modes.