He's born with it. The Ghostly Wail is an innate ability of his half-ghost physiology—not acquired.
He doesn't unlock it via event or artifact; he develops mastery through practice. It's his "ultimate move," first fully unleashed in "The Ultimate Enemy" (future-timeline episode). The ability reflects his hybrid nature: a power inherent to ghosts, refined through human discipline and creativity.