From a purely xAPI standpoint you generally wouldn't do this because the statement producer should be doing it. Now the caveats:
- Unless you consider your LMS the statement producer in which case you could use it to proxy the requests to the LRS and it could manipulate the statement in route. Note this will invalidate signed statements, not that anyone is doing that yet. And will generally require you to proxy all resources, and pay particular attention to the statement writing requests.
- If you control the authoring of the content you could have it make requests to the LMS directly to retrieve additional information that the content should then consider including in the statements. Naturally this option is outside the scope of xAPI directly, and is non-standard.
This particular notion however has been taken up by the cmi5 group and is part of that specification which is now considered production ready. In cmi5 the LMS provides a document in the State API resource, the LMS launch data, that includes a context template that can theoretically hold any information the LMS wants to include in it, and the content (an AU) is required to build the statement context object based off that template and therefore include in each statement what the LMS provided.