pattern matching: how to verify the expression depends on the symbol in a particular way

Consider these two expressions:

expr1 = a d g[X, c]^ 2 + e g[X, f] + 3

expr2 = a d g[X, c]^ 2 + e X + 3

How do I check if these expressions depend on X just like Sun[X, _]. More specifically, I want to verify that any occurrence of X in a given expression it should appear as the first argument of the function of two variables Sun, and in no other way.

In the two previous examples, expr1 satisfies this criterion, expr2 do not.

At this moment I can only think of one way to verify this:

my check[expr_] : = FreeQ[expr/sol[expr/g[expr/sol[expr/g[X, _] :> OK, X];

So, my check[expr1] yields True Y my check[expr2] gives false. Are there other forms, ideally those that go through the expression only once? my check The previous thing crosses the expression twice.