What permissions will be required?
Just Edit on Account?
As well as Read. I realize that you can't have Edit without Read, but it's technically required.
Or will Transfer be required as well?
Transfer provides additional transfer capabilities. Without it, they can still transfer records they own or that their subordinates own.
Does it depend on the value passed in for accId and newOwnerId?
Yes. You need to have Transfer/Full Control on a record in order to assign ownership. You can get this permission level by way of Modify All Data, by Ownership (you own the record), and by Role Hierarchy (one of your subordinates owns the record). If you enable User Sharing as well, newOwnerId must be a user they can see. In addition, newOwnerId must be a user that has Read Accounts or better; you cannot own a record if you cannot see that type of object.
The sharing setting?
No. You can't generically share the ability the transfer accounts. You need to either inherit the permission (owner or subordinate owner) or have a permission that ignores sharing (Modify All Data or Modify All Accounts).