The visual diagnostic for heteroskedasticity is usually done using a scale-location plot for the residuals in the regression. This plot shows the square-root of the absolute studentised residuals (on the vertical axis) against the fitted values (on the horizontal axis). If you are interested in the relationship of the error variance with a particular independent variable (in a multiple linear regression), you could adapt this plot to show the independent variable of interest on the horizontal axis instead of the fitted response value.
If you would like a formal test of increasing variance you could fit a second regression to this data by regressing the root-absolute-residuals from the initial regression against the independent variable of interest. The slope estimate in the latter regression would give you an estimate for the effect of the independent variable on the magnitude of the studentised residuals (through their root-absolute value). This is slightly complicated, given that the exact distribution of the residuals is complicated. Nevertheless, with a large amount of data (such that the initial regression fits the data well) the residuals should approximate the true error terms well, which should allow you to formally test the hypothesis of interest.
gamlss
, for instance stats.stackexchange.com/questions/492021/… $\endgroup$