Learning and attention increase visual response selectivity through distinct mechanisms