I have found the Ramakrishna Order Swami Tapasyananda's explanation of swadharma to be helpful.
I am posting here excerpts from his commentary on the Gita 18.47:
"One's own duty, even if without excellence (i.e. inferior in the scale of
worldy values), is more meritorious spiritually than the apparently
well-performed duty of another. For no sin is incurred by one doing works
ordained according to one's nature, (that is, in consonance with one's own
natural evolution.)"
Excerpts from Swami T's commentary:
This verse, which was easy for our ancients to understand, pose great
difficulty for us today. So long as Varna was identified with endogamous
caste, and valid texts ascribed particular works to each caste (18.41-45),
it was easy to find one's Svadharma. But, as already pointed out, the wording
of the Gita about Caturvanya, except as interpreted by old commentators, does
not by itself mean endogamous castes, but the four psychological types. If
this is accepted, Svadharma would mean only work that springs out of one's
nature and therefore adopted to one's natural development.
The Swami T also says in his commentary on Gita 18.45
"By being devoted to one's own natural duty, man attains to spiritual
competency. Now hear how devotion to one's own natural duty generates
spiritual competency."
the following:
This great verse of the Gita links man's social duties with spiritual
discipline. By cultivating a special attitude towards work, work is turned
into worship, and the distance between the shrine room and the work-spot
disappears. This philosophy is based upon a fundamental faith that this world
and the progress of life in it are all under the guidance of Supreme
Intelligence, who is the master of it all, and whose will is expressed in all
its movements. If man has got this faith, man ceases to be self-centered. He
comes to view himself as a worker of God, and all that he does comes to be
done with a sense of dedication to Him. Such work, as accrues to one according
to one's nature and is done with a spirit of dedication, is called Svadharma,
one's natural duty. This outlook on one's work makes a man free from
corruption and negligence, and induces him to put his best effort into his
work. If an attitude of this type were accepted in a society as a whole, it
will be the best social philosophy, besides being a spiritual doctrine. It
will secure the social good as also bring about the individual's spiritual
evolution.
A natural objection to this way of understanding chaturvarna is that all
commentators understand the four Varnas as endogamous groups called castes,
and their natural duty (swadharma) of theirs as the profession that was
traditionally and scripturally alloted to those groups under the four
distinctive names. Such interpretations of the Gita were given at a time
when these endogamous caste groups were a recognized feature of Indian
society, and thinkers considered birth in a group as tantamount to character
type. The mistake of such identification was obvious to many thinkers of the
past. So some of them have made some kinds of amends for it by admitting that
if great disparity in quality is found in the actual quality of a Kshatriya
with the traditionally ascribed qualities, he can become a Brahmana. But all
rationality seems to have been neutralised by the very strong prejudice in
favour of endogamy.
What the Lord speaks of here as chaturvarna should never be identified with
castes, because the Varna is said to be solely dependent on character formed
by the Gunas of Prakriti. It is only an ideal grouping based on psychological
principle and not on rigid hereditary basis.
Besides the Gita is a universal Gospel addressed to all mankind, for all
time, and not merely to the Indian society of a particular age. In no part
of the world except in India, caste system strictly based on birth seems to
have existed. Loose castes there have been but not rigid castes. So the old
commentators have done great injustice to Sri Krishna in watering down the
significance of his message as relevant only to members of the rigid Indian
social system.
The only practical way of applying the Gita teaching in this respect today is
to consider the duty to which one is called, as one's swadharma. Strictly
Swadharma is work according to one's nature. But until an ideal and efficient
social system comes into vogue, it may not be possible to give every one a
work for which he is suited by his character type. What could be done for
today, if one's duty is not according to one's nature, is to change it for
a more suitable one, considering the former as Paradharma, the duty of
another type of character. But today most men are found seeking not a duty
temperamentally suitable for them, but what will bring them maximum income.
When a duty is valued solely for the income it fetches, it ceases to be a
pursuit of a Dharma or spiritual value. Receiving remuneration for services
is unavoidable for man in the world, but what is unspiritual is to value
the work only for its remuneration, forgetting that the work he does is an
offering to God, irrespective of the remuneration he gets.