I wonder in which way he could possibly have learned it.
Queen affirms to be surprised if a human can use that but still Luffy can go vulcanization yet he is a special case.
Elemental attacks are perhaps something can be indeed used just by special individuals and perhaps Sanji triggered DJ in that Lunarian yet for some special unknoqn reasonsm