Consolidate server actions transform errors into `emit_error` function
This improves maintainability and readability by decluttering the server
actions transforms implementation, dedupes a few error messages, and
consistently uses periods and trailing newlines for all error messages.
The approach is already used for the React Server Components transforms.