There is a standard that covers locking threaded components used in certain safety applications - that is where the threaded component becoming loose or detached would cause a hazard.
The standard does not preclude bespoke solutions, but there are a number of pre-approved locking methods. With one exception, the methods are characterised by being both positive and visually inspectable. Castellated nuts + split pins and wire-locking come to mind from memory. A single fixing relying on a thread locking compound is not accepted, being considered too unreliable for safety purposes as well as not being inspectable.
I'm assuming that the sprocket is held onto the shaft by a screwed collar (I'm not familiar with bicycles - a photo with the post would be good). Taking the safety standard as a lead, personally I would go for wire locking the collar to the shaft or a split-pin through the shaft.
Alternatively, a pin through the sprocket into the shaft flange behind the sprocket - again difficult without seeing whether there is such a flange.
Does this thing need to come apart again - for repair or maintenance? If not can it be brazed?
Come to think of it:
