I don't know exactly how to put this in the transcript, here's the witness' answer. Would I leave it as it is? use quotations, put a dash or hyphen after the letter S?
A. When I saw it and it was about to hit me and I said oh, excuse my expression, S.
When I saw it and it was about to hit me and I said oh -- excuse my expression -- shit.
or
When I saw it and it was about to hit me and I said,"Oh" -- excuse my expression -- "shit."
A. When I saw it and -- it was about to hit me, and I said, "Oh" -- excuse my expression -- "S."
The first dashes just makes it more grammatically correct, but if there was no hesitation or change in tone, leave them out and just make it the run-on sentence as said.
My understanding from your post is the witness said "S" and not "shit." She/he would probably not appreciate you swearing for her/him when she/he used the discretion not to.