5f states in UGa2 probed by x-ray spectroscopies