I don't see a problem with introducing "participating..." as a (lengthy) offshoot of the parallel element "went to Beijing to study philosophy," but I do see a problem with the clause beginning "but never having been registered..."
After the opening introductory phrase "After one year," the sentence splits off into three parallel phrases that branch from the pronoun "I":
quit my job
said goodbye to my friends
went to Beijing to study philosophy
So far, so good. But the remainder of the sentence presents some difficulties. If the entire wording "participating in a lot of classes given by professors, but never having been registered as a formal student" is supposed to build out from the "went to Beijing to study philosophy" branch of the immediately preceding parallel structure, then first of all you need to add "and" before that last branch to make clear to readers that there are three parallel branches and not more:
After one year, I quit my job, said goodbye to my friends, and went to Beijing to study philosophy, participating in a lot of classes given by professors, but never having been registered as a formal student.
At this point, "participating" becomes an alternative way of saying "where I participated," which is fine—except that it calls for bringing the subsequent wording "never having been registered as a formal student" into parallel with "participating in a lot of classes given by professors." The obvious way to do this is to align them as follows:
participating in a lot of classes given by professors
but never registering as a formal student
That leaves you with:
After one year, I quit my job, said goodbye to my friends, and went to Beijing to study philosophy, participating in a lot of classes given by professors, but never registering as a formal student.
If you're satisfied with this wording, you're done. If it sounds a bit gamey to you, you can (with one minor alteration in the Beijing branch of the first set of parallels) turn the "participating..." part of the sentence into a "where" phrase:
After one year, I quit my job, said goodbye to my friends, and went to study philosophy in Beijing, where I participated in a lot of classes given by professors, but never registered as a formal student.
It is also possible to alter the final phrase to say "but never registered as a formal student" and treat it as a fourth branch of the original set of parallels that spring from "I." Doing this turns the phrase "participating in a lot of classes given by professors" into a kind of parenthetical digression from the main points in the series of actions you are recounting and therefore requires stronger punctuation than commas to set it off in a way that readers will immediately recognize:
After one year, I quit my job, said goodbye to my friends, and went to Beijing to study philosophy—participating in a lot of classes given by professors—but never registered as a formal student.
However, I prefer the versions that appear in the two block quotes above this last one.