By matching the solution to the Newtonian theory. This can be done, for example, by comparing the metric of the Schwarzschild solution with weak-field solutions and the standard results of Newtonian gravity. This is often discussed in introductory books in General Relativity, such as Sean Carroll's Spacetime and Geometry, for example.
The constant $K$ is often not treated in textbooks, but notice it can be absorbed by a change of coordinates $t \to \frac{t}{\sqrt{K}}$ (or $t \to \frac{ct}{\sqrt{K}}$, if you do not want to use units with $c=1$), which then allows the metric to be written as
$$\text{d}s^2 = - \left(1 - \frac{S}{r}\right)\text{d}t^2 + \frac{\text{d}r^2}{1 - \frac{S}{r}} + r^2 \text{d}\Omega^2.$$
The advantage of this choice of coordinates is that for $r \to \infty$ we recover an explicit expression of the Minkowski metric, but in principle there is nothing wrong with using different choices of coordinates. Notice that $S$ can be redefined away as easily, for it would require us to redefine $r$ and that would change the angular terms.
Edit: After re-reading the question, I noticed you asked for a general procedure. As far as I know, the most general trick would be having the parameters fitted to experimental data, which is pretty much what we do in all other physical theories (if you are solving $m\ddot{x} = - kx$, you'll fix the integration constants by picking experimental data informing how is the actual physical trajectory or the harmonic oscillator you are studying). In some cases, we can work around this procedure and obtain information in other ways.
For example, the Reissner–Nordström solution has an extra free parameter when compared to the Schwarzschild metric. By considering how this parameter occurs on the electromagnetic field and using Gauss' Law one can figure out that this constant can be interpreted as the black hole's electric charge.
As a second, more general, example, we have the Kerr–Newman solution, which includes Reissner–Norsdtröm as a special case. The Kerr–Newman family has three parameters, which can be physically interpreted as the mass, charge, and angular momentum of the spacetime by explicitly computing these quantities using formulae similar to Gauss' Law (see, e.g., Wald's General Relativity, p. 314). This also provides an alternative, more technical, way of fixing $S$ in the solution you've written down.
The Friedmann–Lemaître–Robertson–Walker solutions, which describe an Universe that is spatially homogeneous and isotropic, have quite some more freedom, and one of the free parameters is the spatial curvature $k$. This can be negative, zero, or positive, and in principle it has to be experimentally fixed.
In summary, there is no general method (that I know of) apart from "compare it with experiment". Notice that, in fact, even when comparing with Newtonian theory we are still not fixing $S$: we are just rewriting it in a more convenient way after figuring out that $M = \frac{S c^2}{2G}$ has a more profound meaning that $S$ itself. To properly fix $M$, we still need an experiment telling us the mass of the object inducing the gravitational field.