Find basis so Transformation Matrix will be diagonal $e_1,e_2$ will be basis for $V$. $W$ has a basis $\{e_1+ ae_2,2e_1+be_2\}$. Choose an $a,b$ s.t. that the basis for $W$ will have a transformation matrix $T$ will be in diagonal form.
$T(e_1) = 1e_1+5e_2$
$T(e_2) = 2e_1+4e_2$
$V$ and $W$ are linear spaces of dimension $2$.

It helps to write this up in matrices. If we use the standard basis $\{e_1,e_2\}$ for $V$ and $W$, the linear transform $T:V\to W$ is given by
$$
T = \begin{pmatrix}
1 & 2 \\ 5 & 4
\end{pmatrix}.
$$
Next, the matrix
$$
P = \begin{pmatrix}
1 & 2 \\ a & b
\end{pmatrix}
$$
takes vectors written in the $\{e_1 + a e_2, 2 e_1 + b e_2\}$ basis and returns them in the standard $\{e_1,e_2\}$ basis. (To see this, observe that in the $\{e_1 + a e_2, 2 e_1 + b e_2\}$ basis, the vector ${1\choose0}$ represents the element $e_1 + a e_2$ which is written ${1\choose a} = P{1\choose 0}$ in the $\{e_1,e_2\}$ basis.)
So $P^{-1}$ takes vectors written in the $\{e_1,e_2\}$ basis and returns them in the $\{e_1 + a e_2, 2 e_1 + b e_2\}$ basis. 
If we want $T:V \to W$ to be diagonal in the $\{e_1 + a e_2, 2 e_1 + b e_2\}$ basis, this is the same as requiring that $P^{-1}T$ be diagonal.
Now use the formula for matrix inverses to get $P^{-1}$, multiply this with $T$ to get $P^{-1}T$, and solve for $a$ and $b$ such that the resulting matrix is diagonal.
As some of the commenters to the question have observed, setting $a=5, b=4$ gives $T =P$, so $P^{-1}T = I$, which is diagonal. However, this approach works for more general cases where $T$ may not be so nice.
Edit: I realize I might have been hasty in assuming we want $T:V\to W$. If we really want $T:W \to W$ to be diagonal, then we should solve for $a,b$ such that $P^{-1}TP$ is diagonal, or equivalently $$TP = P\begin{pmatrix}* & 0 \\ 0 & *\end{pmatrix}.$$
