Hi, suppose I want to estimate the following system of equations, and that I want to capture how does the variable weight indirectly influences the variable price. How could I do so using margins?

Code:
sysuse auto

sureg (price = mpg) (mpg= weight)

margins, dydx(weight)

If I run the code above, I only get weight's direct effect on mpg.

I know this is easy to calculate by hand, but I would like to have an answer that generalizes to non-linear models, such as a combination of probit-linear regression.