I prefer the first sentence. pay attention to something -- "something" can be a noun or gerund and the word 'to' is a preposition In you second sentence the word 'to' can only be interpretted as meaning 'in order to'. In other words, the second sentence refers to ' paying attention ( to something ) in order to enhance speaking ability'.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.