Let me label your circuit nodes for better understanding of your question

simulate this circuit – Schematic created using CircuitLab
To answer your question I must first clarify some definitions:
- Error gain function: a gain k that multiplies the error e = r-y
- Transfer function: the behavior of the closed-loop system y/r
Now,
$$
y=k\cdot e
$$
$$
e=r-y
$$
$$
y=k\cdot (r-y)
$$
So, the error gain function follows as
$$
k=\frac{y}{r-y}
$$
So, you don't even need the transfer function to establish the value of k. You just need y and r.
Anyway the transfer function is
$$
TF=\frac{y}{r}=\frac{k}{k+1}
$$
So, if you're given the transfer function (note that this is just a constant for this theoretical system) you can find k as
$$
k=\frac{TF}{1-TF}
$$
Note also that, with negative feedback, in stable system conditions, and with finite k:
$$
0\leq TF<1
$$
E(s) = Y(s) - X(s)G(S)
, where X : is the desired output(input to system) , and G is the error gain function , then X(s)G(S) = X(s) . which is equal to Y(s) , then E(s) = 0. \$\endgroup\$