We consider a scalar-tensor theory of gravity wherein the scalar field $\phi$
includes the gravitational coupling $G$ and the speed of light $c$, both of
which are allowed to be functions of the spacetime coordinates. The effect of
the cosmological coupling $\Lambda$ is accommodated within a possible behaviour
of $\phi$. The dynamics of $\phi$ is analyzed in the phase space where we
describe gravity from a precisely specified form of the action. For reasonable
assumptions on the potential $V\left(\phi\right)$ and the matter-energy
content, we show that an attractor point can be reached regardless the type of
Hubble parameter functional behaviour. The phase space analysis is performed
both with the linear stability theory and via the more general Lyapunov’s
method. When the system gets to the stable point, the dynamics of $\phi$ ceases
and the constraint $\dot{G}/G=\sigma\left(\dot{c}/c\right)$ with $\sigma=3$
must be satisfied for the rest of the cosmic evolution. The latter result
realizes our main motivation: To provide a physical foundation for the
phenomenological model admitting
$\left(G/G_{0}\right)=\left(c/c_{0}\right)^{3}$ used recently to interpret
cosmological and astrophysical data. The thus co-varying couplings $G$ and $c$
impact the cosmic evolution after the dynamical system settles to equilibrium.
The secondary goal of our work is to investigate how this impact occurs. This
is done by constructing the generalized continuity equation in our
scalar-tensor model and considering two possible regimes for the varying speed
of light\textemdash decreasing $c$ and increasing $c$\textemdash while solving
our modified Friedmann equations. It is shown that cosmic evolution after the
equilibrium accommodates radiation- and matter-dominated eras that naturally
evolve to an accelerated expansion typical of dark energy.