The modifications in this package are described in more detail here.
The transformed AMP HTML produced by the library is meant to be used inside of a signed exchange, but may be valid in other contexts, as well.
The local transformer can be used separately from the packager/signer. Here's an example use of the binary:
go get -u github.com/ampproject/amppackager/cmd/transform
$GOPATH/bin/transform -url "documentURL" /path/to/html
For more help, $GOPATH/bin/transform -h
See the binary source code for an example use of the library.