Plate glass is extremely flat. You take a piece of plate glass, and hold it against the upper portion of the forks. The part that does not slide. If the forks are aligned the glass will not rock. It will stay flat against the forks. If they are even a little bit out, the glass will rock a little bit.
Here's something I wrote up after I came up with the procedure. I had used glass to check flatness of other things in the past.
The procedure I came up with uses a piece of quarter inch thick plate glass. The glass is about 3.5" by 10.75" with the edges sanded down smooth. I had a piece laying around and cut it shorter so it would fit on the exposed part of the forks. Of course, you need to make sure it is flat, but that is pretty much standard with plate glass. The 3.5" was the largest I could get that could be used on both my bikes. I won't get into details of the whole fork tightening procedure as it may be different on different bikes. The assumption is that everything is in spec, nothing bent or broken and the forks are clean. For the ST1300 with the bike on the center stand and the front wheel in the air and the left axle pinch bolts loose, I place the glass against the fork tubes. If the forks are square, the glass will sit nicely against both forks. If the forks are even a little bit tweaked, the glass will be able to be rocked. If this happens, you need to slightly partially loosen the fork clamps and using the front wheel, tweak the forks in the other direction. A little experimentation here and you will get the forks perfect (within the limits of your measuring device).
The glass sits on the forks. You do not want to just lay it on the fork guards as it is in the photo, you need to hold it against the forks. Be VERY careful about scratching it.