Spin–state transition in the layered barium cobaltite derivatives and their thermoelectric properties