I think your problem would be simpler if you explicitly broke it down to
$$
H=H_0 + \lambda H^\prime_0+\lambda H_1
$$
where $H_0$ is already diagonal. In your example:
$$
H_0=\begin{pmatrix}\epsilon_1&0&0&0&0&0&0\\ 0 &\epsilon_2&0&0&0&0&0\\
0&0&\epsilon_2&0&0&0&0\\
0&0&0&\epsilon_2&0&0&0\\
0&0&0&0&\epsilon_2&0&0\\
0&0&0&0&0&\epsilon_3&0\\
0&0&0&0&0&0&\epsilon_3\\
\end{pmatrix}\, .
$$
The matrix $\lambda H_0^\prime$ is a block diagonal matrix containing entries in the $4\times 4$ subspace of vectors with eigenvalues $\epsilon_2$ of $H_0$, and the $2\times 2$ subspace of vectors with eigenvalues $\epsilon_3$ of $H_0$. Thus, $\lambda H_0^\prime$ has the form
$$
\lambda H_0^\prime=
\begin{pmatrix}1&0&0&0&0&0&0\\ 0 &*&*&*&*&0&0\\
0 &*&*&*&*&0&0\\
0 &*&*&*&*&0&0\\
0 &*&*&*&*&0&0\\
0&0&0&0&0&*&*\\
0&0&0&0&0&*&*\\
\end{pmatrix}\, .
$$
where $*$ denote non-zero entries, not necessarily identical, located to indicate the shapes of the degenerate subspaces.
Finally, the matrix $\lambda H_1^\prime$ will generally have non-zero entries connecting the subspaces; it is of the general form
$$
\lambda H_1^\prime=
\begin{pmatrix}\ast&\ast&\ast&\ast&\ast&\ast&\ast\\ \ast&0&0&0&0&\ast&\ast\\
\ast &0&0&0&0&\ast&\ast\\
\ast &0&0&0&0&\ast&\ast\\
\ast &0&0&0&0&\ast&\ast\\
\ast &\ast&\ast&\ast&\ast&0&0\\
\ast &\ast&\ast&\ast&\ast&0&0
\end{pmatrix}\, . \tag{1}
$$
Basically, you have broken up your perturbation into two parts: one that acts inside each degenerate subspace, and one that acts in between the degenerate subspaces. The procedure is then as you suggest: because any linear combination of vectors with eigenvalue $\epsilon_2$ is also an eigenvector with eigenvalue $\epsilon_2$, you use this freedom to make a change of basis $T$ so $\lambda H_0^\prime\to \lambda T H_0^\prime T^{-1}$ is diagonal, and use this new basis to proceed with the transformed $\lambda TH_1^\prime T^{-1}$ using regular perturbation theory. Note that the change of basis induces a change in $H_1^\prime$ so that $\lambda TH_1^\prime T^{-1}$ can have in general non-zero entries at different places than in (1).
The assumption here is that no eigenvalues in $H_0+\lambda T H_0^\prime T^{-1}$ are repeated, else the perturbation approach fails, in the sense that you cannot get second order corrections using the standard perturbation theory. If some eigenvalues of $H_0+\lambda T H_0^\prime T^{-1}$ are repeated, you might get lucky with the form of $\lambda TH_1^\prime T^{-1}$ and still be able to proceed, but this would be an exception rather than a general case.