How can pilots identify, in flight, the cracked layer(inner/middle/outer) from an impaired windshield?
It is possible to identify whether the crack affects the inner layer by sliding over it with nail or something sharp like pen. If the layer is cracked, the slight indenting in the surface can be felt.

As far as I can tell, there is no way to tell whether the outer or middle layer is affected with any useful degree of certainty. It is also not possible to ascertain how many layers are cracked. So usually the procedure is so that if the inner layer is not affected, you can continue and fix the issue at destination and if the inner layer is affected, you have to conservatively assume all layers may be affected and descend.