Nondestructive determination of energy‐gap grading in thin films by optical transmission measurements