Statemachine as a separate module in VHDL?
You can define your type for the states in a VHDL package.  Then include the package where your state machine is and in the file where you instantiation of that component is.

Another, but less beautiful, solution could be to assign in every state of the statemachine a value to a std_logic_vector output.

E.g.:

case current_s is
    when s0 =&gt;
        ....;
        state &lt;= x"00";
    when s2 =&gt;
        ....;
        state &lt;= x"01";
    when s1 =&gt;
        ....;
        state &lt;= x"02";


I would go for the first solution if your code is not shared with other designs or other people.  

For IP's, I would go for the second solution.  Some design rules will reject non standard input and outputs.  

If you want to put the state into a debug register, the second solution will be the best (no problems with recoding of the states by the synthesis tool)