Dear Student,
It is only an convention that magnetic field line originate from north and terminate at south end
of the magnet and it is true every where wether it is inside of the magnet or out side of the magnet
your concern is how magnetic line originate from south pole inside magnet basically to understand
it you can put a very small magnet at the south pole of magnet whose south pole is in out ward direction
and its north pole is in inside so we can say south pole of magnet for inside line act as north pole
that is why we say magnetic line originate from south pole of the magnet inside the magnet .
Regard