As nicely explained in thia post, I would recommend the followings:
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
RepeatMasker -pa 2
Then, you will get 8 cores. Your RepeatMasker will spawn two engine. Each engin would use 4 cores.