(look in "parameterization")
The formula is well known, and dates back decades based on Kirkwood's work (assumes integration an orthogonal unit cell going across the interface). The procedure for air/liquid or liquid/liquid is basically the same: use a unit cell with constant volume, and all liquids must be in equilibrium for it. Because fluctuations of the pressure tensor are big, expect slow converge and some sensitivity to cutoffs. Isotropic fluids (aside from the interface) will converge much better than oriented fluids like lipid membranes.
Specifically in LAMMPS, you can define the formula for gamma as an equal-style variable, and print it through a custom thermo output or fix props.