Martensitic transformations in a thin layer of a shape memory alloy on an elastic substrate