You unlock him by clearing the Great Ape level. Super Saiyan 4 is the reward for getting through that stage, so there is no code or hidden item involved — just progress.
If you have beaten it and he still is not available, check that you finished the level rather than merely reaching the end of it, since some versions require the full clear. Beyond that, the game's own transformation menu will show what is still locked and why.