Before a transplant of hair is performed there is a shaving of the head done, is that permitted?
What part of the head would need to be shaven seems the first question to ask, but there are much more questions to be asked, and you already went a step too far ahead because it is not merely about the basic do’s or don’ts, what is your motivation to possibly have your temples shaven... as it is not for live saving brainsurgery for which no prohibitions would exist.
What is the motivation for wishing a hairtransplant, i.e. Do you otherwise lose your job and income to feed yourself and family, Are you married and if not: do your jewish friends and rabbi/hakham say that finding your soulmate is intensely hampered by your baldness, does your baldness make you feel a freak because you are relatively young and psychologicaly insecure about your appearance and therapy does not help overcome that?
Is having a hairtransplant common practice within your local jewish peergroup?
Would having the hairtransplant mean you have to work more hours to make up for the money it costs and have less time for Torah, family, friends and community or do you have plenty of excess savings that are not needed as reserve for when the phase of the financial-economic cycle moves downward again after years of up, or foreseable future expenses as education for your children and giving to charity for example.
Are you living in a good environment or are you strong enough (like Joseph in Egypt) to live a good jewish life in a bad environment? If you think you could do better, what are the options to relocate?