If you are transferring cold-crashed beer, you can observe the level of beer in the keg by the condensation forming on the surface. Personally, brewing a slightly lower quantity of beer to ensure that the beer doesn't overflow has been the easiest solution.