You earn new gags by using the ones you already have on Cogs. Every successful use builds toward the next gag in that track.