Theory of probing a photonic crystal with transmission near-field optical microscopy