There is a way to do it without changing any hex data to do this you have to use Visual studio(I used the 2013 version) to open Pkhex's soure code, which can be downloaded here: https://github.com/kwsch/PKHeX(on the website download the zip file and then unzip it) Then press start after Visual studio has opened Pkhex and this starts up pkhex but this message should appear, Illegal mode active, please behave, press ok and pkhex should be running but the ability isn't limited to the legal abilities of the pokemon but I would recommend making the pokemon on the legal pkhex first then changing the ability with the illegal version because the illegal version sometimes freezes (In my experience)
If you have questions just ask (Encase this explanation was unclear)