Testing for latent structure via the Wilcoxon--Wigner random matrix of normalized rank statistics