Since Virtualbox 5.2 does not exist in the repos, I presume you installed it from the Oracle repo. The extension pack is not in any repo so the first time it needs to be downloaded and installed manually. You can download it from here:
https://download.virtualbox.org/virtualbox/5.2.6/Oracle_VM_VirtualBox_Extension_Pack-5.2.6-120293.vbox-extpack
After the download is finished, double-click on the file and Virtualbox will start and the extension installation wizard will begin automatically. Enter the root password when asked and the installation will finish.
The next time Virtualbox gets updated, the first time you run it, it will detect that an old extension pack is installed and it will ask you whether you want to install the new one or not. When you click Yes, it will download the new one and install it by itself.