Illegal? Only for you.
Kidding! It's your computer, right? Do whatever you want to it. But if you have to ask whether or not it's legal, you probably want to find out a little more about overclocking before you attempt it, yeah?
And you will void your warranty, of course.
You could get a friend to do it, but it's probably best to do some research. Then, once you know a bit more, you should do it yourself. I think that'd be better in the long run. You will want to fiddle with this computer, yeah? And you might end up wanting to overclock your future computers.
Well, if I totally misunderstood the situation then just ignore me 😱