Back when the NIIT first started, I was advised on the “old” Fairmark forum that one reasonable method was the “before and after” method, and I have been using that ever since. I do not know of anything you can read about this.
I calculate the state income tax based just on the non-investment income, and subtract that from the total state income tax. The result is the allocation for NIIT. So far this has proved to be more favorable than the ratio of investment income to AGI because my state income tax is so progressive.
In my case federal AGI is a factor in the calculation of state income tax, so the federal tax based on non-investment income also has to be calculated.
However, as explained by Kaye Thomas in my recent thread “Net Investment Income Tax”, only state income tax deducted on line 5a of Schedule A(1040) for a particular year can be used for calculation of the allocation on Form 8960 for that year, and starting with tax year 2018 the allocation may not exceed $10,000.