Network mechanisms underlying the role of oscillations in cognitive tasks