Or does he just have the authority to do so as the Son of God?
Actually, he has the authority to do so as "the Son of man."
Mar 2:5
When Jesus saw their faith, he said unto the sick of the palsy, Son, thy sins be forgiven thee.
Mar 2:6
But there were certain of the scribes sitting there, and reasoning in their hearts,
Mar 2:7
Why doth this
man thus speak blasphemies? who can forgive sins but God only?
Mar 2:8
And immediately when Jesus perceived in his spirit that they so reasoned within themselves, he said unto them, Why reason ye these things in your hearts?
Mar 2:9
Whether is it easier to say to the sick of the palsy,
Thy sins be forgiven thee; or to say, Arise, and take up thy bed, and walk?
Mar 2:10
But that ye may know that the Son of man hath power on earth to forgive sins, (he saith to the sick of the palsy,)
Mar 2:11
I say unto thee, Arise, and take up thy bed, and go thy way into thine house.
Mar 2:12
And immediately he arose, took up the bed, and went forth before them all; insomuch that they were all amazed, and glorified God, saying, We never saw it on this fashion.
Like how come he could do so before he was crucified and raised from the dead?
I will not be dogmatic with this answer, but I do believe that it is the proper answer to your question.
It is important to note that Jesus' earthly ministry began after he was water baptized. I personally believe that, in type, Christ needed to be buried, resurrected, ascended, and glorified before he could be baptized with the Holy Ghost, and before he could perform any miracles. When Jesus was literally buried, resurrected, ascended, and glorified, all power was given unto him in heaven and in earth (Matthew 28:18), or he was restored to his former glory which he had before the foundation of the world (John 17:5), and prior to his incarnation, or when he was only fully God, but now as one who is both God and man (Son of man). I believe that by experiencing these things, in type, at his baptism, he was given the authority to do these things before he had literally fulfilled any of the types.
In relation to his authority as "the Son of man," elsewhere, Jesus said this:
Jhn 5:26
For as the Father hath life in himself; so hath he given to the Son to have life in himself;
Jhn 5:27
And hath given him authority to execute judgment also, because he is the Son of man.
The Father has given Jesus the authority to execute judgment because he is the Son of man. Again, because Jesus has been exalted back to the Father's right hand as one who is now both God and man, he has been given the authority to judge mankind.
Anyhow, just pray and ask God if what I am suggesting here is true. In any case, Jesus forgave sins as "the Son of man;" even as he said that he did.