In criminal law, guilt is entirely externally defined by the state, or more generally a “court of law.” Being “guilty” of a criminal offense means that one has committed a violation of criminal law, or performed all the elements of the offense set out by a criminal statute. The determination that one has committed that violation is made by an external body (a “court of law”) and is, therefore, as definitive as the record-keeping of the body. So the most basic definition is fundamentally circular: a person is guilty of violating a law, if a court says so.
Philosophically, guilt in criminal law is a reflection of a functioning society and its ability to condemn individuals’ actions. It rests fundamentally on a presumption of free will, in which individuals choose actions and are, therefore, subjected to external judgement of the rightness or wrongness of those actions.
See also Cotton, Michael, A FOOLISH CONSISTENCY: KEEPING DETERMINISM OUT OF THE CRIMINAL LAW, 15 B.U. Pub. Int. L.J. 1 (“A substantial body of scholarship has concerned itself with the importance of free will to the theory of the criminal law. Even given the importance of the subject, the quantity of attention is surprising because of the lack of fundamental disagreement among scholars, who overwhelmingly endorse the criminal law's assumption of free will.”)