We have to show that $\operatorname{\bf tr}_B O_{AB}$, the partial trace of $O_{AB}$ with respect to B, is independent of the chosen basis.
Let $\{\ket{u_j}\}$ and $\{\ket{v_j}\}$ be bases of $B$ related by $\ket{u_j} = \sum_i T_{ij}\ket{v_i}$. The transformation $T$ given by the matrix $T_{ij}$ in basis $\{\ket{v_j}\}$ maps $\ket{v_j}$ to $\ket{u_j}$ and is a unitary transformation. In particular, we have the useful relationship (orthonormal rows):
(1)Beginning with the expression for the partial trace $\operatorname{\bf tr}_B O_{AB}\colon A \to A$ in the basis $\{\ket{u_j}\}$, we can now rewrite it to the same expression in the basis $\{\ket{v_j}\}$. For any $\ket a \in A$:
(2)This shows that the operator $\operatorname{\bf tr}_B O_{AB}$ is the same in both bases of $B$.