风骚 originally referred to two sections of classical Chinese poetry: 《国风》 (from the Book of Songs) and 《离骚》 (by Qu Yuan). Together they represented the pinnacle of literary excellence. The meaning 'flirtatious' is a later colloquial extension.
usage
Context is crucial: 独领风骚 (to stand out, be the best) is entirely positive, while 卖弄风骚 (to flaunt one's sex appeal) is negative. The literary meaning is formal; the flirtatious meaning is colloquial.