You would use the concept of conditional expectation to derive the formula. Conditional expectation is defined analogously to regular expectations, except with conditional probabilities instead of prior probabilities. If $X$ is a discrete random variable and $A$ an event, then the conditional expectation of $X$ given $A$, denoted $\mathrm{E}[X|A]$ is defined as:
$$\mathrm{E}[X|A] = \sum_{x} x P(X=x|A)$$
Note that this could just as well have been regarded as the expectation of some new random variable $Z$ whose distribution is the conditional distribution of $X$ given $A$, since conditional probabilities are just probabilities, so all of the useful properties of expectations like linearity of expectation still hold. Note that if $X$ is independent of $A$ then $\mathrm{E}[X|A]=\mathrm{E}[X]$ since $P(X=x|A)=P(X=x)$.
In our derivation we will also use a so-called law of total expectation. Let $\{A_i\}$ be a finite or countable collection of events that partition the sample space. Then:
$$\mathrm{E}[X] =\sum_i \mathrm{E}[X|A_i]P(A_i)$$
To see that the above is true, use the definition of conditional expectation:
\begin{align}
\sum_i \mathrm{E}[X|A_i]P(A_i) &= \sum_i \left(\sum_x x P(X=x|A_i)\right)P(A_i)\\
&= \sum_x x \sum_i P(X=x|A_i)P(A_i)\\
&= \sum_x x P(X=x)\\
&= \mathrm{E}[X]
\end{align}
where I have used the law of total probability, $P(X=x) = \sum_i P(X=x|A_i)P(A_i)$, in line 3. Now with that background, we can see how we would derive the system of equations in your question.
Let $X$ be defined as in your question. Let $B$ be the event that the first dice roll is a 6 and let $A$ be the event that the first dice roll is not a six. Note that $\{A,B\}$ form a partition of the sample space. By law of total expectation:
$$\mathrm{E}[X] = \mathrm{E}[X|B]P(B)+\mathrm{E}[X|A]P(A)$$
We know that $P(B) = \frac{1}{6}$ and that $P(A) = 1-P(B)= \frac{5}{6}$. I use $X|A$ to denote the random variable obtained from the conditional distribution of $X$ given $A$. Now, both $X|A$ and $X|B$ are new random variables. Each dice roll is independent and the number of additional rolls $Z$ needed to roll 2 consecutive 6's given event $A$ has the same distribution as $X$. Therefore, $X|(A= \text{event that first dice roll is not a 6)}=1+Z$ has the same distribution as $1+X$. Hence we have $\mathrm{E}[X|A] = \mathrm{E}[1+X] = 1+\mathrm{E}[X]$, by linearity of expectation. The distribution of $X|(B=\text{event that first roll is a 6})$ is trickier, however, and cannot be related to $X$ as simply as in the case of event $A$. We can define a new random variable, $Y$, which is the number of additional rolls needed to roll 2 consecutive 6's after the first roll, so $X|B = 1+Y|B$. We have $\mathrm{E}[X|B] = \mathrm{E}[1+Y|B] = 1 + \mathrm{E}[Y|B]$. Let $a = \mathrm{E}[X]$ and let $b=\mathrm{E}[Y|B]$. The equation we derived now reads:
$$a= \frac{5}{6}(1+a)+\frac{1}{6}(1+b)$$
We are almost there! We just need an expression for $\mathrm{E}[Y|B]$ in terms of itself and $\mathrm{E}[X]$. Let $C$ be the event that the second dice roll is a 6, and let $D$ be that the second dice roll is not a six; again, $\{C,D\}$ partition the sample space. Again, using law of total expectation:
$$\mathrm{E}[Y|B] = \mathrm{E}[Y|C,B]P(C|B)+\mathrm{E}[Y|D,B]P(D|B)$$
Here $\mathrm{E}[Y|C,B]$ denotes the conditional probability of $Y$ given events $C$ and $B$ both occurred. Since the dice rolls are independent, we have $P(C|B) = P(\text{rolling a 6}) = \frac{1}{6}$ and $P(D|B) = 1-P(C|B)= \frac{5}{6}$.
Now, $\mathrm{E}[Y|C,B] = \sum_y y P(Y=y|C,B)$, where I write $P(Y=y|C \cup B)$ for $P(Y=y|C,B)$. But, if the first dice roll is a 6 and the second dice roll is also a 6, then $Y=1$. So, $\mathrm{E}[Y|C,B]=1$. Now, if events $D$ and $B$ both occur (the first two dice rolls are not 6's), we are back at the situation we have started with, needing to count the number of rolls needed until we roll 2 consecutive 6's. Therefore, the conditional distribution of $Y$ given events $D$ and $B$ occurred (the first two dice rolls are not 6's) is the exact same as the distribution of the random variable $1+X$ (Can you see why?). Therefore, $\mathrm{E}[Y|D,B] = \mathrm{E}[1+X] = 1 + \mathrm{E}[X]$, and so we finally arrive at the second equation:
\begin{align}
\mathrm{E}[Y|B] &= \mathrm{E}[Y|C,B] P(C|B) + \mathrm{E}[Y|D,B]P(D|B) \\
&= (1)\frac{1}{6}+\left(1+\mathrm{E}[X]\right)\frac{5}{6}
\end{align}
Or, written in terms of our variables $a$ and $b$:
$$b = \frac{1}{6}+(1+a)\frac{5}{6}$$
And that is the long way to derive that systems of equations.