Full photon statistics of a light beam transmitted through an optomechanical system