As far as I'm aware, covariant vectors are defined by how they transform:

But I've also heard that the covariant components of a vector are defined as the dot product of the vector and the various basis vectors.
My question is, how do you prove that a covariant vector transforms in this way, given that covariant components are defined as being the dot product with the basis vectors?
Let $y = f(x)$, where $f$ is some (possibly nonlinear), vector-valued function. The transformation law for a covariant vector can be written
$$W' = \overline f^{-1}(W)$$
Where $\overline f$ is the transpose of the Jacobian of $f$. This is entirely equivalent to the definition given in the question.
The components of $W'$ can be extracted by dot products with basis vectors:
$$W_m' = W' \cdot e_m = \overline f^{-1}(W) \cdot e_m$$
The RHS is equivalent to $W \cdot \underline f^{-1}(e_m)$ (this is the very definition of transposing). So, we used the $e_m$ basis vectors to extract components from $W'$. Then, the $e_m$ basis vectors are associated with the coordinates expressed in $y$. The basis vectors associated with the coordinates in $x$ are $\underline f^{-1}(e_m)$.