Probing the formation of polarons in organic semiconductors and their optoelectronic properties