I want to learn a real microcontroller with STM32F4. Which library should I use (HAL, SPL, or CMSIS)?
If you really want to learn a specific microcontroller, ditch the vendor provided libraries (which are often bug ridden anyway), and work from the datasheet to set registers up yourself.

You're best to structure your code so the libraries aren't integrated into your application. Keep hardware access to a thin interface layer which you can easily swap out if you change silicon vendor without having to make changes throughout your code base.