Which basis does the wavefunction collapse to?
The system doesn't "know" anything.
The only uncontroversial statement one can make about the (strong) measurement of a quantum system is that you will make the correct predictions if you assume that the state after the measurement was the eigenstate corresponding to the measured value of the observable (so, for position, indeed a $\delta$-function, if we ignore issues with that not being a real function, which would be a distraction here). But what we mean by "state" in the first place - i.e. what ontology, if any, corresponds to the statement "the system is in the quantum state $\lvert \psi\rangle$" - is ambiguous to begin with:
Whether the original state "collapsed" to this new state, whether the "state" is just an imperfect representation of our knowledge and the "collapse" is just updating our information (cf. "$\psi$-ontic" vs "$\psi$-epistemic", see e.g. this answer by Emilio Pisanty) instead of an actual physical process, or something else entirely, is a matter of quantum interpretation. In some interpretations, there is collapse, in others there isn't, but in any case, the formalism of quantum mechanics itself does not provide a single "correct" interpretation.
That is, your question is essentially unanswerable unless you specify the interpretation within which it is to be answered. But none of the predictions of quantum mechanics depends on it anyway - you do not need to have a concept of "how" collapse works to compute the outcome of measurements.
This question is about what is called the "preferred basis problem" and it is a well-studied aspect of quantum measurement theory.
There are two aspects to the measurement problem:
If we adopt the collapse postulate, then for any given measurement-like interaction, how is the measurement basis determined?
What is the nature of the evolution of the system such that it finally arrives in one state of that basis?
The question here is mainly concerned with 1. This is the part of the measurement problem which can be resolved by the study of decoherence, which goes as follows.
It can happen that for one basis an off-diagonal density matrix element such as $\langle \phi_i |\psi\rangle \langle \psi | \phi_j \rangle$ (where $\phi_i$ are states of the basis) will either evolve very quickly or can be sensitive to very small disturbances, whereas for another basis this may not be so. In this case the off-diagonal elements of the density matrix average to zero over any practical timescale, so we have decoherence between states of such a basis. It is called a pointer basis. It is a basis in which the density matrix of the sytem is diagonal. In this case the future evolution of the system is indistinguishable from that of a system which is in one and only one of these basis states, drawn randomly with a probability obtained from the density matrix in the standard way.
One can also get a diagonal density matrix by taking an average over parts of the environment which have become entangled with the system. In either case the resulting decoherence solves the preferred basis problem, but it does not address the wider issue of exactly how to interpret the physical implications of the mathematics of quantum theory. That is, you can still take your pick from single-world or many-world interpretations, and the ontological status of the wavefunction or state-vector is not settled by this type of study.
The collapse happens in all bases. What I mean by that is that the wavefunction can be expressed in any basis you want to. It's just that the easiest basis to look at right after measurement is the one corresponding to what you measured, since the state is the eigenstate corresponding to your measurement.
Always remember the wavefunction isn't physical. It's an abstract thing that we can only describe and "look at" as shadows from their projections. We can choose any projection we want to, but that choice doesn't change the wavefunction.
I guess the essence of my question was how is this "measurement basis" determined? It makes sense that you can still describe the vector in any basis, but my understanding is that measuring the wavefunction in different ways will cause it to collapse differently...so what determines which way it will collapse?
I am not sure what you exactly mean here, but I will attempt to address it. You start with your system in some state $|\psi_\rangle$. You perform a measurement of some observable of your system. Let's say you measure the energy and your (ideal) measurement procedure gives you and energy of $E$. Your system is now in a new state $|\psi'\rangle$. How do the initial and final states relate to each other?
It turns out that the final state is an eigenstate of the Hamiltonian of your system with eigenvalue $E$. In other words $$H|\psi'\rangle=E|\psi'\rangle$$ In other other words, in the "energy basis" your new state only has a non-zero component in one "direction", that being in the "direction" of the basis state whose energy eigenvalue is $E$.
What about the initial state? Well in general is has many non-zero components in the energy basis. i.e (assuming an infinite, discrete energy spectrum) $$|\psi_\rangle=\sum_{n=1}^{\infty}A_n|\psi_n\rangle$$ Where each $|\psi_n\rangle$ is an energy eigenstate. i.e. $H|\psi_n\rangle=E_n|\psi_n\rangle$ where $E_n$ is some energy (of which one is the $E$ mentioned earlier).
So you could describe this "wavefunction collapse" as follows. Before measurement my state was $|\psi\rangle=\sum_{n=1}^{\infty}A_n|\psi_n\rangle$. After measurement my state "collapsed" to one of the $|\psi_n\rangle$ states which we called $|\psi'\rangle$ Is there a way to know which $E_n$ we will get before measurement? No, all we know is the probability of measuring this which is determined by $|A_n|^2$, but we cannot say which state (which "way") this collapse will occur.
However, the point of my answer is that we don't need to work in the energy basis to describe the collapse. We could express $|\psi\rangle$ and $|\psi'\rangle$ in a different basis, say the position basis. Then we would have $$|\psi\rangle=\int_{-\infty}^{\infty}\psi(x)|x\rangle\,\text dx$$ $$|\psi'\rangle=\int_{-\infty}^{\infty}\psi'(x)|x\rangle\,\text dx$$ where $|x\rangle$ are position basis state vectors. The measurement still changed the state independent of the basis we choose ($\psi(x)\neq\psi'(x)$ in general). So the collapse still happened, we can just view it from different bases. For energy, $A_n\to\delta_{n,m}$ where $\delta_{n,m}$ is the Kronecker delta function. For position, $\psi(x)\to\psi'(x)$. But $|\psi\rangle$ and $|\psi'\rangle$ are still the same states in either basis; they are just represented in a different way mathematically.
Therefore, the state vector does not "collapse to a basis". After measurement it can still be expressed in any basis. What you measure determines in which basis it only has one component in though. Perhaps this is what you were wondering. However, we do not know which basis vector in this case, just the probability of ending up with a certain basis vector.