Assuming the Axiom of Choice, and therefore assuming that every vector space has a Hamel basis, it isn't too hard to show that if $U$ and $V$ are vector spaces with the same dimension (i.e. their bases have the same cardinality), then $V\cong U$. However, I'm not so sure how to deal the converse implication (assuming it's true in general in the first place):
Let $\mathcal B_1$ be a basis for $V$ and $\mathcal B_2$ a basis for $U$. If $V\cong U$ then there exists a linear map $\phi: V\to U$ that is bijective, and so particularly, $\text{Im}(\phi) = U = \langle \mathcal B_2\rangle$.
I'm not sure how to conclude that $\phi(\mathcal B_1)=\mathcal B_2$. I thought of using the First Isomorphism Theorem ($V/\text{ker}(\phi)\cong \text{Im}(\phi)$) to mimic the Rank-Nullity Theorem being used for the finite-dimensional case, but it doesn't really help in this scenario.
Suppose that $\mathcal B_1 = (v_\alpha : \alpha \in I)$ is a basis of $V$ and that $\phi: V \to U$ is a bijective linear map. We now consider $\mathcal B_2 = \phi(\mathcal B_1) = (\phi(v_{\alpha}): \alpha \in I)$.
Claim: $\phi(\mathcal B_1)$ spans $U$.
Proof: Consider an arbitrary $u \in U$. $\phi$ is surjective, so there exists a $v \in V$ with $\phi(v) = u$. Because $\mathcal B_1$ is a (Hamel) basis, there exist elements $v_{\alpha_1}, \dots, v_{\alpha_n}$ and coefficients $c_1,\dots,c_n$ such that $$ v = \sum_{i=1}^n c_i v_{\alpha_i} \implies u = \phi(v) = \sum_{i=1}^n c_i \phi(v_{\alpha_i}). $$
Claim: $\phi(\mathcal B_1)$ is linearly independent.
Proof: Suppose that $v_{\alpha_1},\dots,v_{\alpha_n}$ and coefficients $c_1,\dots,c_n$ are such that $\sum_{i=1}^n c_i \phi(v_{\alpha_i}) = 0$. It follows that $\phi \left(\sum_{i=1}^n c_i v_{\alpha_i} \right) = 0$. Because $\phi$ is injective, it must holds that $\sum_{i=1}^n c_i v_{\alpha_i} = 0$. Because $\mathcal B_1$ is a basis, this can only hold if $c_{\alpha_1} = \cdots = c_{\alpha_n} = 0$.
So, $\phi(\mathcal B_1)$ is indeed linearly independent.
Because $\phi(\mathcal B_1)$ is a linearly independent spanning set, it is a basis.