In Hatcher's Vector Bundles and K-theory the following description of orientability of a vector bundle $E \mapsto B$ is given:
For a vector bundle $E\mapsto B$ with $B$ path-connected, orientability is detected by the homomorphism $ \pi_1(B) \mapsto \mathbb{Z}_2$ that assigns 0 or 1 to each loop according to whether orientations of fibers are preserved or reversed as one goes around the loop. Since $\mathbb{Z}_2$ is abelian, this homomorphism factors through the abelianization $H_1 (B)$ of $\pi_1 (B)$, and homomorphisms $H_1 (B)→\mathbb{Z}_2$ are identifiable with elements of $H^ 1 (B; \mathbb{Z}_2 ).$ Thus we have an element of $H ^1 (B; \mathbb{Z}_2 )$ associated to $E$ which is zero exactly when $E$ is orientable. This is exactly the first Stiefel-Whitney class $\omega_1 (E).$
Where is the association of element of $H^1(B; \mathbb{Z}_2)$ to $E$ coming from?
I think I'll be able to see that this element is zero if $E$ is trivial if I understood what this association is.