So where do occult powers come from anyway?
First off, let's talk about where occult powers come from. Occult powers are the balance to "the gift". Practitioners of occult powers were sealed away by the gifted into the Third Kingdom. But because of the universal need for balance, occult powers have leaked out into Richard and Kahlan's world.
[Red explained,] “The gift itself is balanced between Additive Magic and Subtractive Magic. Yet on a larger scale, the totality of that internal balance within the gift—the gift itself—is balanced by occult powers.
“Back in the great war, those like Sulachan were defeating the gifted. That threatened to throw the worlds of life and death out of balance. The gifted prevailed, though, sealing those with occult powers behind the barrier. The gift thus gained dominance. But because everything always seeks balance, they knew the seals on the barrier could not last forever, and indeed they haven’t. Occult powers have been leaking out for some time, and now they are once again fully free and among us.”
—Severed Souls, Chapter 66 (Sword of Truth Book 14)
So occult powers are a natural force that people tap into, rather than something that is generated by their own actions.
Being in close proximity to where occult power is leaking into the world is the main cause of having the innate ability to use it
Ludwig Dreier has the ability to use occult powers, and his internal thoughts show that he thinks his innate ability to use it is a direct result of his lifelong proximity to that natural force. He also believes that Hannis Arc has the ability to use it for the same reason (emphasis mine).
Ludwig had been born close to the profound occult powers contained for thousands of years beyond the great barrier to the north. All of that occult power could not be contained forever, and the barrier had failed to prevent it from occasionally escaping, even before the barrier itself had finally failed completely. Ludwig had always known that at least some of his innate ability had been a result of those powers slipping through the barrier, unnoticed, and settling in his spark of life at conception.
That had been the source of much of Hannis Arc’s ability, as well as many of the lesser talents of some of the cunning folk out in the wilds of the Dark Lands. But Ludwig had such abilities as well, and in greater abundance, augmenting his gift. For that reason, his abilities, and his powers, were unique even if they had remained unrecognized all this time.
—Severed Souls, Chapter 34 (Sword of Truth Book 14)
So presumably, even if someone like Richard or Kahlan had been born in the same locations as Ludwig Dreier or Hannis Arc, they too would have acquired the innate ability to use occult powers.
The passage above does say that this is the result of "at least some of his innate ability", leaving open the possibility of other sources. Presumably, there was some level of training as well from people like Sulachan. But ultimately, we are not privy to those sources, and it's possible that the practitioners themselves do not fully know its source.